does git amend require a git push -f?

git

Solution

A `git commit --amend` or a `git commit --author=<author>`, if anything is modified, will generate a different SHA1. Then, yes, a `git push -f` will be needed.

`git amend` can be defined as an alias like in this blog post:

git config --global alias.amend 'commit --amend -C HEAD'

This alias adds a `git amend` command that will reuse the current commit message when it amend it.

Problem

``` make changes git commit 'made changes' -a git push origin make more changes git ammend -a git push origin ``` I've noticed that when I do a `git commit --ammend -a` and then try to push to a remote repo, it requires that I force the push (`git push -f`). My guess is because it's trying to push the same (?whats the word?) commit code but notices differences in files. Is this correct / normal?

Original source

Related problems