我如何才能在rebase中使用不同的策略? [英] How could I use a different strategy for just one commit in a rebase?
本文介绍了我如何才能在rebase中使用不同的策略?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
master A --- B --- G --- H --- I
\
分支C --- D --- E --- F
有没有办法进行以下操作,但仅对C提交使用 -X theirs
master A --- B --- G --- H --- I
\
branch C' - D' --E' - F'
(我创建了一个分支来迁移从VS2008到VS2010的大型解决方案,分支上的第一次提交是改变所有项目文件的提交,现在我想更新分支以获得最新的更改,但不必手动合并由工具生成的任何冲突代码)
- 首先将
C
合并为master
,并使用中详细说明了merge --strategy = theirs
。 - 然后
git rebase master
(它不应该重复提交C
,因为它已经合并,并且与分支
的C
相同。
Given this:
master A---B---G---H---I
\
branch C---D---E---F
Is there anyway to get to the following, but using -X theirs
only for the C commit?
master A---B---G---H---I
\
branch C'--D'--E'--F'
(I've created a branch for migrating a big solution from VS2008 to VS2010. The first commit on the branch was the one that changed all the project files. Now I would like to update the branch to get the latest changes, but without having to manually merge any conflicts arising from tool-generated code)
解决方案
You could try to:
- merge first
C
tomaster
, using one the themerge --strategy=theirs
detailed in this SO answer. - then
git rebase master
(which shouldn't repeat commitC
, since it has already been merged and is identical to theC
ofbranch
).
这篇关于我如何才能在rebase中使用不同的策略?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文