开发者

Git merge Spaghetti - How to fix it?

开发者 https://www.devze.com 2023-01-27 00:05 出处:网络
It seems like we\'ve done a bit of merge \"spaghetti\" with git. We are new to this and would basically like to have the following branches

It seems like we've done a bit of merge "spaghetti" with git.

Git merge Spaghetti - How to fix it?

We are new to this and would basically like to have the following branches

Master  A - B - C 
            __//
Core       /   A - B - C - D - E - F  
          |
iPhone    A - B - C  

But it seems like at some point we merged master into core, then core back to master, then master back to core .. not sure what / how / why did this happen .. but I would love some help to put this back on track without messing around to开发者_运维百科o much !

Any help is appreciated.


So you want to linearize the "Core" branch? Why not just git rebase it ?

Master  A - B - C 
            __//
Core       /   D - E - F - G - H - I
          |
iPhone    J - K - L


git checkout core
git rebase C   [where "C" is the sha1 of C]

If you see any conflict, do a git rebase --abort to back to previous state.

0

精彩评论

暂无评论...
验证码 换一张
取 消