Answer
Asking what the first section of git rerere diff
means is fine but misguided. Instead, examine the -
and +
annotations. From the Git Book:
git rerere diff
will show the current state of the resolution - what you started with to resolve and what you’ve resolved it to.
Anything prefixed with -
or no prefix
is what you started with to resolve:
<<<<<<<
puts 'hello mondo'
=======
puts 'hola world'
>>>>>>>
Anything prefixed with +
or no prefix
is what you've resolved it to (and is what you currently have in your working dir):
<<<<<<< HEAD
puts 'hola world'
=======
puts 'hello mondo'
>>>>>>> rerere2
Detailed Explanation
Contents of Working Dir
Immediately after merge, the working directory contains:
def hello
<<<<<<< HEAD
puts 'hola world'
=======
puts 'hello mondo'
>>>>>>> rerere2
end
Output of git diff
The output of git diff
is this and uses the combined diff markup:
def hello
++<<<<<<< HEAD in working dir but in neither ours/theirs
+ puts 'hola world' in working dir but not in theirs
++======= in working dir but in neither ours/theirs
+ puts 'hello mondo' in working dir but not in ours
++>>>>>>> rerere2 in working dir but in neither ours/theirs
end
If we look at the working dir file of simple.rb, this is true. It's contents are the same as the git diff
output but without the ours/theirs markers.
Output of git rerere diff
And the output of git rerere diff
is this and does NOT use the combined diff format.
def hello
-<<<<<<< started with
- puts 'hello mondo' started with
-======= started with
+<<<<<<< HEAD resolved to
puts 'hola world' started with & resolved to
->>>>>>> started with
+======= resolved to
+ puts 'hello mondo' resolved to
+>>>>>>> rerere2 resolved to
end
- anything with a
-
is part of what you've started with
- anything with a
+
is part of what you've resolved to
- anything with no prefix is part of both
If we look at just what has the -
annotation, we have this:
-<<<<<<<
- puts 'hello mondo'
-=======
->>>>>>>
That says that the left side brings in puts 'hello mondo'
and the right side brings in nothing. If we look at just what has the +
, we have this:
+<<<<<<< HEAD
puts 'hola world'
+=======
+ puts 'hello mondo'
+>>>>>>> rerere2
That's exactly what is in the working directory right now.