How to push to repo after doing 'git commit --amend'
If you are ok with modifying the history on the remote repo (as in, you just pushed that commit, and no new commits were made), you can try a
git push --force
However, do read first "How do I push amended commit to the remote git repo?": if anyone already pulled from that repo, he/she won't be happy.
An alternative is described in "Git: pushing amended commits".
As mentioned by cpeisert in the comment "master
branch and 'origin/master
' have diverged, how to 'undiverge' branches'?" described your warning message.