Information Technology Reference
In-Depth Information
With the above command you will get a file in which conflicts are denoted with
<<<<<<< ours
and
>>>>>>> theirs
labels, as in:
1
<<<<<<< ours
two
=======
deux
>>>>>>> theirs
3
The above output doesn't contain the original line before the branches
en
and
fr
diverged. If that is important to you, use the command:
$ git checkout --conflict=diff3 numbers.txt
It will create the file with the contents shown in
Listing 9-7
. This time, the file con-
tains another section tagged
base
. The
base
section displays the version stored in a
merge baseāthe commit returned by the
$ git merge-base en fr
command.
Listing 9-7.
The conflict presented in diff3 format
<<<<<<< ours
two
||||||| base
2
=======
deux
>>>>>>> theirs
3
Hint
In Recipe 5-12 we discussed the command to restore an arbitrary file from an
arbitrary revision:
$ git checkout [REVISION] [filename]
. It can be ap-
plied instead of using
--ours
or
--theirs
parameters. In this recipe, the command
$ git checkout en numbers.txt
is equivalent to
$ git checkout --