在git中,其commit提供了一個--amend參數,可以修改最后一次提交的信息
修改最后一次提交注釋 git commit --amend
然后在出來的編輯界面,直接編輯注釋的信息,保存退出
git rebase -i HEAD~3
git使用amend選項提供了最后一次commit的反悔。但是對於歷史提交呢,就必須使用rebase了。
修改push后的歷史提交注釋
這個命令出來之后,會出來三行東東:
pick:*******
pick:*******
pick:*******
如果你要修改哪個,就把那行的pick改成edit,然后保存退出。
git commit --amend
修改注釋
git rebase --continue
合並注釋
git log
查看提交記錄
提交修改后的注釋
git pull origin master
git push origin master