简体   繁体   中英

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

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.

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}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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