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?
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 amendcommand that will reuse the current commit message when it amend it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With