In Git, how do you apply a commit of bug fix to the other newer branches?

后端 未结 3 592
花落未央
花落未央 2021-01-06 18:34

If I have a public Git repository that contains 3 branches like the following:

  (release-to-customerA)
      |
      U               (master)
     /                 


        
3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-06 19:18

    You shouldn't rebase in this situation, since clearly other people have seen commits C through T.

    As Greg said, you can use git-cherry-pick to get just U; but, this will create a new commit with the same diff but a different ID. If you want to get all commits in release-to-customerA into release-to-customerB and master, you can use git-merge like so:

    git checkout release-to-customerB
    git merge release-to-customerA
    
    git checkout master
    git merge release-to-customerA
    

提交回复
热议问题