This is what happens:
- After a recent commit to remote master, I make a small trivial change to my local repo
- I add
git commit --amend
and leave the same commit message as HEAD - I try to push the repo to master with
git push
And now I get
On branch master
Your branch and 'origin/master' have diverged,
and have 1 and 1 different commit each, respectively.
(use "git pull" to merge the remote branch into yours)
nothing to commit, working directory clean
I want to understand:
- Why this exactly happens?
- What can I do to prevent this?
- How do I reconcile master with local after a git amend?