Information Technology Reference
In-Depth Information
First, rewinding head to replay your work on top of it...
Applying: Cat
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
warning: Cannot merge binary files: picture.jpg (HEAD vs.
Cat)
Auto-merging picture.jpg
CONFLICT (add/add): Merge conflict in picture.jpg
Failed to merge in the changes.
Patch failed at 0001 Cat
The copy of the patch that failed is found in:
c:/git-recipes/09-06/.git/rebase-apply/patch
When you have resolved this problem, run "git rebase
--continue".
If you prefer to skip this patch, run "git rebase --skip"
instead.
To check out the original branch and stop rebasing, run
"git rebase --abort".
Rebasing was paused and you have to resolve conflict. The output of
$ git
status -s
is:
AA picture.jpg
To restore an image displaying a cat from branch
a
use the
$ git checkout -
-theirs picture.jpg
command. This time
--ours
means branch
b
and
--
theirs
means branch
a
.
Finish the recipe with the
$ git add picture.jpg
and
$ git rebase -
-continue
commands. Finally open your favorite image editor and verify that
pic-
ture.jpg
displays a cat.
How It Works
The binary conflicts during rebasing are handled almost identically as in Recipe 9-5.
The only difference between merging and rebasing is that the roles of
--ours
and
--
theirs
are reversed. This is summarized in
Table 9-1
.