I just read the release notes for Git 2.35.0 (note 2.35.1 is already available though).
In those release notes, I saw that:
- "Zealous diff3" style of merge conflict presentation has been added.
My questions:
- How do I make git diff / difftool default to "zealous " diff presentation?
- What are the pros and cons of using it over the default diff presentation mode?
The new "zealous diff3" style is:
which you'd set with:
for instance (assuming you want this in your per-user configuration).
The default style is
merge
:(this example is straight from the
git merge
documentation). Thediff3
style adds the merge base version in the middle, with vertical bars:Note that in order to show the difference between the base version and both branch-tip versions, the line:
which used to be outside the
<<<<<<< ... >>>>>>>
section (because it was cleanly resolved) is now inside this section.What
zdiff3
does is take the same "or cleanly resolved" path thatmerge
takes:This is a lie, of sorts, but it's a useful lie.
Note that if you'd like, you can take any existing conflicted file and re-create the conflict in a new merge style:
(or the same with
git restore
but I haven't retrained my fingers yet ). Be careful with this as it overwrites any attempt you've made at merging.