git rebase: copy instead of moving

后端 未结 2 814
南笙
南笙 2021-02-12 00:59

My branches are:

o---o  support.2013.16
     \\
      o---o---o---o---o  master
                       \\
                        o---o---o  hotfix/A
         


        
2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-12 01:28

    You could create a new branch:

    git checkout -b hotfix/A-support hotfix/A
    

    and rebase it instead. So you will have two branches. Maybe you may decide to drop the branch after merging it into the support branch.

    Alternatively, you could rebase the hoftix/A onto the git merge-base support.2013.16 master and then you could easily merge the hotfix/A into both branches. It will give you prettier history, no duplicate commits.

提交回复
热议问题