Error when pushing amended commit to remote

This question already has an answer here:

  • How do I push amended commit to the remote Git repository? 13 answers

  • Each commit in Git is identified by a hash.

    As it happens, you push a first commit with a specific hash. Then you change its hash by distorting the commit (with the git commit --amend command).

    So, when you push it again to the server, he don't understand what you want to do, hence the error.

    You can oversteep this error with: git push -f your_origin your_branch . It's not recommended but it's possible.

    链接地址: http://www.djcxy.com/p/48916.html

    上一篇: 修改后如何推送到GitHub

    下一篇: 将修改的提交推送到远程时出错