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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 15:16:21  来源:igfitidea点击:

How do I resolve cherry-pick conflicts using their changes?

git

提问by antak

My git cherry-pick FOOproduced 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 svnequivalent was choosing theirs-conflictto 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}