想要从git中永久的删除一个commit,可以使用
1 | $ git rebase -i HEAD~4 |
-i是交互模式,在弹出的编辑中,d删除对应的commit即可。
这是个vi编辑器,编辑后退出,git将执行rebase和gc
Successfully rebased and updated refs/heads/merge_linux.
Auto packing the repository in background for optimum performance.
See "git help gc" for manual housekeeping.