Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to git cherry-pick a commit with binary files

I am trying to cherry-pick a commit from a different branch that is mostly binary files. It seems it is mostly successful, except for one file where I get the message:

warning: Cannot merge binary files: XXXX.so (HEAD vs. d8ef550... Add support for 32-bit apk)
error: could not apply d8ef550... Add support for 32-bit apk
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'

I can do a 'git add' on that file, but the results are not what I was expecting. I expected it to be a modification, but it turned out to remove that file in question. The commit I am trying to cherry pick modifies some binary files as well as deletes a few.

So, the question is...what is the best way to cherry-pick a commit w binary files ?

like image 529
Sofia Clover Avatar asked Jun 06 '17 18:06

Sofia Clover


1 Answers

You can do this with git cherry-pick --strategy=recursive -X theirs {Imported_Commit}

(You may need to abort the current cherry-pick first; git cherry-pick --abort)

like image 157
Alejandro C. Avatar answered Sep 18 '22 08:09

Alejandro C.