我试图帮助一位同事从另一个功能分支意外创建了一个功能分支,而不是从主分支创建第二个功能分支。这里基本上是我们现在所拥有的......
大师--- A --- B --- C \\ \\ Foo E --- F --- F --- H \ Bar J --- K --- L --- M这就是我们想要的...
大师--- A --- B --- C | \ Foo | E --- F --- F --- H | Bar J --- K --- L --- M想到的是创建FooV2和BarV2分支,然后樱桃挑选单个提交到适当的V2分支。但我很好奇,是否有更好的方法来处理这种情况?
解决方案它看起来像我可以:
git checkout J git rebase master编辑:
我尝试了我的建议,但不起作用。 knittl的建议不起作用(在我的盒子里)。这是什么为我工作:
git rebase --onto master foo bar
I'm trying to help out a coworker who accidentally created one feature branch from another feature branch, rather than creating the second one from master. Here is essentially what we have now…
Master ---A---B---C \ Foo E---F---F---H \ Bar J---K---L---MAnd here is what we'd like to have…
Master ---A---B---C |\ Foo | E---F---F---H | Bar J---K---L---MOne way I thought of would be to create FooV2 and BarV2 branches, and cherry-pick the individual commits into the appropriate V2 branches. But I'm curious, is there a better way to handle this situation?
解决方案It looks to me like you could:
git checkout J git rebase masterEdit:
I tried what I suggested and it doesn't work. knittl's suggestion doesn't work (on my box). Here's what did work for me:
git rebase --onto master foo bar
更多推荐
将git分支分成两个分支?
发布评论