Accidentally pushed commit: change git commit message
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: In my local repo I have one commit with an incorrect commit message. I've already published the incorrect commit message with git push . Now the remote repo (which is GitHub-hosted) has the incorrect commit message, too. I've already tried git commit --amend , but found that it will not work for me in this situation because I've made additional commits since the incorrect one. How would you fix this situation? 回答1: Easiest solution ( but please read this whole answer before doing this ): git rebase -i In the editor that opens, change pick to