Say I have a merge conflict in Git, and try to resolve it with vimdiff using diff3
view. Here is a screenshot:
Now while resolving, I want to diffget
once from LO
see how it looks like, undo, and then diffget
from RE
. Another situation is that I have diffget
ed from the wrong place, say LO
, so I want to undo and diffget
the correct one, say RE
.
So first of all I do :diffget LO
and get what is expected:
So far everything is ok, but now I want to undo the last diffget
, to diffget
from RE
. So I undo with u
and get to what I had before (though, note the highlighting difference):
And now simply diffget
from RE
:
So I got one additional redundant octocat
line diffget
ed from RE
.
Below is what I was expecting:
+----------+------------+
| actual | expected |
+----------+------------+
| cat | cat |
| dog | dog |
?? | octodog | octodog |
----> | octocat | octocat |
| octocat | |
+----------+------------+
So my question is, why is this happening? And how can I achieve the behaviour I expected?
diff3
view, so that the middle one is the Common Ancestor, and the bottom one is the Merge Result. I got it with git config,merge.tool=vimdiff
andmerge.conflictstyle=diff3
.:diffupdate
after:diffget ...
solves the issue.