threads / discuss / 28068

cherry-pick cannot merge binary files? (also strategy does not work?)

Subject: cherry-pick cannot merge binary files? (also strategy does not work?)

## tl;dr

One message between Aug 11, 2011 and Aug 11, 2011.

replies: 0people: 1as markdown or json

Piotr Krukowiecki· Aug 11, 2011, 12:58 UTC · lore
Hi,

It seems cherry-pick can't merge binary files. I suppose this can be considered a bug or a feature. But I expected I could use "theirs" merge strategy to overcome (auto-resolve) this - but it seems it's either not working, or I'm doing something wrong. Any hints?

[t]$ git init
Initialized empty Git repository in /tmp/t/.git/
[t (master)]$ echo a > a.txt && gzip a.txt && git add a.txt.gz && git
commit -m base
[master (root-commit) 64587708] base
 1 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 a.txt.gz
[t (master)]$ mv a.txt.gz a.txt && gzip a.txt && git add a.txt.gz &&
git commit -m 1
[master 7b73fea9] 1
 1 files changed, 0 insertions(+), 0 deletions(-)
[t (master)]$ git checkout -b two HEAD^
Switched to a new branch 'two'
[t (two)]$ mv a.txt.gz a.txt && echo b > a.txt && gzip a.txt && git
add a.txt.gz && git commit -m 2
[two 57723852] 2
 1 files changed, 0 insertions(+), 0 deletions(-)
[t (two)]$ git cherry-pick master
warning: Cannot merge binary files: a.txt.gz (HEAD vs. 7b73fea9... 1)

error: could not apply 7b73fea9... 1 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' [t (two|CHERRY-PICKING)]$ git reset [t (two)]$ git cherry-pick --strategy=recursive --strategy-option=theirs master warning: Cannot merge binary files: a.txt.gz (HEAD vs. 7b73fea9... 1)

error: could not apply 7b73fea9... 1 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'

Thanks,
-- 
Piotr Krukowiecki

← back to recent threads