git remove merge commit from history

后端 未结 4 1744
再見小時候
再見小時候 2020-11-29 15:55

My Git history looks like that :

\"Git

I would like to squash the purple commits into a singl

4条回答
  •  鱼传尺愫
    2020-11-29 16:39

    Do git rebase -i this will allow you to remove the merge commit and the log will be one single line as you wanted. You can also delete any commits that you do not want any more. The reason that your rebase wasn't working was that you weren't going back far enough.

    WARNING: You are rewriting history doing this. Doing this with changes that have been pushed to a remote repo will cause issues. I recommend only doing this with commits that are local.

提交回复
热议问题