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

Git

Git Problem Overview


My git cherry-pick FOO produced a conflict.

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.

How do I do this in 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 Solutions


Solution 1 - Git

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}

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionantakView Question on Stackoverflow
Solution 1 - Gitelhadi dp ıpɐɥןǝView Answer on Stackoverflow