如何使用“zealous diff3”用吉特?有什么优点和缺点?
我刚刚阅读了 Git 2.35.0 的发行说明 (注意 2.35.1 已经可用)。
在这些发行说明中,我看到:
- 添加了“Zealous diff3”风格的合并冲突呈现。
我的问题:
- 如何使 git diff / difftool 默认为“热心”差异演示文稿?
- 与默认的差异呈现模式相比,使用它有哪些优点和缺点?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
新的“zealous diff3”样式是:
您可以设置它
例如,
(假设您希望在每用户配置中使用它)。默认样式是
merge
:(此示例直接来自
git merge
文档)。diff3
样式在中间添加了合并基础版本,并带有竖线:请注意,为了显示 base 版本和两个分支提示之间的差异版本,该行:
曾经位于
<<<<<<<<<<<<<
之外 ... >>>>>>>
部分(因为它已完全解决)现在在此部分中。zdiff3
所做的是采用与merge
相同的“或完全解析”路径:这在某种程度上是一个谎言,但它有用说谎。
请注意,如果您愿意,您可以获取任何现有的冲突文件,并以新的合并样式重新创建冲突:(
或与
git Restore
相同,但我还没有重新训练我的手指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.