Information Technology Reference
In-Depth Information
The merging is paused and the conflicting binary file is denoted with:
AA picture.jpg
by the
$ git status -s
command. You have to choose exactly one version of
a file. To choose an image displaying a dog use the
$ git checkout --theirs
picture.jpg
command.
Once you have checked out the appropriate version of a file you can change the
status of the file from
AA
into
M_
. This is done with the
$ git add picture.jpg
command. Committing the change with
$ git commit --no-edit
you will fi-
nalize the merging. When merging is finished open your favorite image editor and veri-
fy that
picture.jpg
displays a dog.
How It Works
Binary files cause more trouble-free conflicts than text files. That's because git cannot
merge two different binary files into one file. There is no method to produce the
merged file that is presented in
Figure 9-6
. You can only do it using an image editor,
such as Gimp, git cannot help you with this. For a binary file you can only request the
first or second version of a file. This is done with two commands:
$ git checkout --ours [filename]
$ git checkout --theirs [filename]