git 如何使用它们的更改解决挑选冲突?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14337945/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do I resolve cherry-pick conflicts using their changes?
提问by antak
My git cherry-pick FOO
produced a conflict.
我的git cherry-pick FOO
产生了冲突。
I could go through the conflicting files and delete the lines between <<<<<<<
and =======
, and the conflict markers themselves, but I'm hoping there's an easier way.
我可以继续通过相互冲突的文件,并删除之间的界限<<<<<<<
和=======
冲突标记自己,但我希望有一个更简单的方法。
I think the svn
equivalent was choosing theirs-conflict
to resolve.
我认为svn
相当于选择theirs-conflict
解决。
How do I do this in git
?
我如何做到这一点git
?
I don't want git checkout --theirs <file>
as that seems to produce the same result as git checkout foo <file>
instead of just getting git diff FOO~..FOO <file>
applied.
我不想git checkout --theirs <file>
因为这似乎产生相同的结果git checkout foo <file>
,而不是刚刚git diff FOO~..FOO <file>
应用。
回答by elhadi dp ?p????
First you should undo your cherry-pick, try to run this
首先你应该撤销你的cherry-pick,尝试运行这个
git cherry-pick --abort
Second, try to make cherry-pick, but in this time you get their changes not yours, so make this:
其次,尝试选择cherry-pick,但此时您得到的不是您的更改,因此请执行以下操作:
git cherry-pick --strategy=recursive -X theirs {Imported_Commit}