Rebasing a Git merge commit

后端 未结 5 936
滥情空心
滥情空心 2020-11-27 09:10

Take the following case:

I have some work in a topic branch and now I\'m ready to merge back to master:

* eb3b733 3     [master] [origin/master]
| * b6         


        
5条回答
  •  无人及你
    2020-11-27 09:53

    It looks like what you want to do is remove your first merge. You could follow the following procedure:

    git checkout master      # Let's make sure we are on master branch
    git reset --hard master~ # Let's get back to master before the merge
    git pull                 # or git merge remote/master
    git merge topic
    

    That would give you what you want.

提交回复
热议问题