How to run git rebase interactive mode to remove duplicate commits

限于喜欢 提交于 2019-11-29 07:19:26

Give git rebase the number of commits back in time. For 10 commit back in history:

git rebase -i HEAD~10

Then simply delete the lines for the commits you want to remove in the text editor that is shown. Saving the file and exiting will start the rebase and the lines that were removed will no longer be in the history once the rebase has completed.

I successfully removed the duplicate commits. Here is what I did: hard reset to the branching point, pull from origin, start git rebase -i SHACODE (original branching point), pick the commits that I want to keep, git rebase to the current SHACODE.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!