0. git commit --amend 可以修改最后一次 commit
1. // 查看修改
git rebase -i master~1 //最后一次
git rebase -i master~5 //最后五次
2. // 显示结果如下,修改 pick 为 edit ,并 :wq 保存退出
pick 92b495b 2009-08-08: ×××××××
# Rebase 9ef2b1f..92b495b onto 9ef2b1f
#
# Commands:
# pick = use commit
# edit = use commit, but stop for amending //改上面的 pick 为 edit
# squash = use commit, but meld into previous commit
#
# If you remove a line here THAT COMMIT WILL BE LOST.
# However, if you remove everything, the rebase will be aborted.
#
3. 命令行显示:
Rebasing (1/1)
You can amend the commit now, with
git commit --amend
4. 使用 git commit --amend 进行修改,完成后 :wq 退出
5. 使用 git rebase --continue 完成操作
阅读(7816) | 评论(0) | 转发(0) |