P
P
Pavel Bykov2018-07-08 22:32:04
git
Pavel Bykov, 2018-07-08 22:32:04

How to merge 2 binary files in git?

Hello, there was such a problem, I can’t merge 2 binary files in git when resolving a conflict (I also tried the GitKraken utility, but it doesn’t help either (see screenshot) i.e. I can’t put a checkmark on 2 files at once, and what to do in such a situation?
VRzzEbF.png

Answer the question

In order to leave comments, you need to log in

4 answer(s)
G
GavriKos, 2018-07-08
@GavriKos

And how do you imagine the result of the work of "two ticks at once"?
Fragment from and then fragment from b? Or vice versa? And where is the guarantee that after such a binary file it will be possible to read at all - git is not aware of its internal structure?
That's because it's impossible to answer all these questions unambiguously, which is why git won't let you "merge" binary files. The way out is to take only one of the options, and then apply changes to it in the appropriate software that understands a specific binary format.

S
Stalker_RED, 2018-07-08
@Stalker_RED

If something doesn't work out for you, try reading the instructions! ©
Git is for sources, not binaries.

E
Eugene, 2018-07-09
@immaculate

Binary files should not be stored in a repository. With very rare exceptions, but if you understand why you put the binary in the repository, then you will not have such questions, most likely.

S
SagePtr, 2018-07-09
@SagePtr

In such cases, you need to resolve the conflict manually, and not rely on checkboxes. The checkboxes are here only if you want to select either file A or file B.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question