简体   繁体   English

如何使用他们的更改解决挑选挑战?

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

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>

First you should undo your cherry-pick, try to run this 首先你应该撤消你的樱桃选择,尝试运行它

git cherry-pick --abort

Second, try to make cherry-pick, but in this time you get their changes not yours, so make this: 其次,尝试做出樱桃挑选,但是在这个时候你得到的改变不是你的,所以这样做:

git cherry-pick --strategy=recursive -X theirs {Imported_Commit}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM