我对 git 很陌生,想知道这样的事情是否可能?
>git log --pretty=oneline --abbrev-commit
2f05aba Added new feature
3371cec Fixed screw up <-- I want to remove this
daed25c Screw up <-- and remove this.
e2b2a84 First. So it's like they never happend.
这可能吗?
如果您确实希望删除它们(将它们从历史记录中删除,再也不会被看到),您可以
运行变基:
git rebase -i HEAD~4
然后,只需删除(或注释掉)与您要删除的提交相对应的行,如下所示:
pick 2f05aba ... #will be preserved
#pick 3371cec ... #will be deleted
#pick daed25c ... #will be deleted
pick e2b2a84 ... #will be preserved
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)