Git 的 commit message 写错了,有办法进行修改么

2025年05月05日 14:58
有1个网友回答
网友(1):

asiest solution (but please read this whole answer before doing this):
1. git rebase -i (这里可以用要改的那次的hash,如果是前一两次也可以用HEAD^或者HEAD^^)
2. In the editor that opens, change pick to reword on the line for the incorrect commit.
3. Save the file and close the editor.
4. The editor will open again with the incorrect commit message. Fix it.
5. Save the file and close the editor.
6. git push --force to update GitHub