Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git "Cannot merge binary files" error in continuous integration build

We have an automated system which merges our development branch into a release branch.

The merge is done via the command git merge -s recursive -X theirs development.

The problem we encounter is that the merge fails on binary files when merging development into release.

The error is: "warning: Cannot merge binary files: Resources/Main/Images/image.png (HEAD vs. development)".

How do I merge the two branches without user-interaction? Everything coming from development into release is allowed to 'win' the merge.

like image 742
Tycho Pandelaar Avatar asked Sep 26 '12 10:09

Tycho Pandelaar


2 Answers

Looks like you have a space in there after the -X, try:

git merge -s recursive -Xtheirs development
like image 144
Paul Oliver Avatar answered Sep 28 '22 08:09

Paul Oliver


git merge allows to use a merge strategy saying that in case of conflicts "our changes" always win or "their changes" always win. Use either

git merge -X ours ...

or

git merge -X theirs ...
like image 30
CharlesB Avatar answered Sep 28 '22 09:09

CharlesB