Tuesday, 3 September 2013

Git prevents pushing after amending a commit

Git prevents pushing after amending a commit

Usually, I just run
git add file
git commit
git push
but if I amend the commit before pushing it (with git commit --amend), the
push fails with
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
How can I let git push the changes without merging branches? I only have
one branch (master) and I'm the only person using this repo so why is it
saying this?

No comments:

Post a Comment