Information Technology Reference
In-Depth Information
you edit the file and then stage it. The same rule applies here:
staging a file resolves a
conflict
.
The four states of
numbers.txt
file as shown in Listings 9-2, 9-3, 9-7, and 9-9
can be retrieved with the following commands:
$ git checkout --ours numbers.txt
$ git checkout --theirs numbers.txt
$ git checkout --merge numbers.txt
$ git checkout --conflict=diff3 numbers.txt
But be careful: this time the meaning of
--ours
and
--theirs
is reversed:
--
ours
means the
fr
branch and
--theirs
means the
en
branch. That's because the
rebasing starts with the checkout of the latest commit in the
fr
branch.
When all conflicts are resolved you can continue rebasing with
$ git rebase -
-continue
or you can abort the operation with
$ git rebase --abort
. The
Hint
Resolving a rebase conflict consists of three steps: 1) editing a file; 2) staging a
file with the
$ git add
command; and 3) finishing the rebasing with the
$ git
rebase --continue
command.
9-4 Creating conflicting changes in bin-
ary files
Problem
You want to create a repository containing two branches that when merged or rebased
would produce a conflict in binary files. The repository you want to create is shown in