Git版本控制——场景九:重写历史

410 阅读1分钟

重写历史

步骤1 - 修改提交信息
通过git rebase -interactive重写存储库历史。

git rebase --interactive --root

进入到交互式编辑器

    /home/scrapbook/tutorial/.git/rebase-merge/git-rebase-todo              

pick bd2175a Initial comit of the list #这里的comit拼写错误,因此将pick修改为reword
pick a51c91e New Item
pick ad6a644 Final Item

# Rebase ad6a644 onto 719d7d6 (3 commands)
#
# Commands:
# p, pick = use commit
# r, reword = use commit, but edit the commit message
# e, edit = use commit, but stop for amending
# s, squash = use commit, but meld into previo