Rebase feature branch onto another feature branch

后端 未结 3 918
渐次进展
渐次进展 2020-11-30 16:33

I have two (private) feature branches that I\'m working on.

a -- b -- c                  <-- Master
     \\     \\
      \\     d -- e           <-- Br         


        
3条回答
  •  感动是毒
    2020-11-30 17:04

    1. Switch to Branch2

      git checkout Branch2
      
    2. Apply the current (Branch2) changes on top of the Branch1 changes, staying in Branch2:

      git rebase Branch1
      

    Which would leave you with the desired result in Branch2:

    a -- b -- c                      <-- Master
               \
                d -- e               <-- Branch1
               \
                d -- e -- f' -- g'   <-- Branch2
    

    You can delete Branch1.

提交回复
热议问题