我更喜欢使用 meld
作为 diff 工具。但是它没有快速解决所有简单冲突的选项,所以在 merge 的情况下我想使用 kdiff3
我已将 merge.tool
设置为 kdiff3 并将 diff.guitool
设置为融合,但 git difftool
仍然始终运行 kdiff3
[merge]
tool = kdiff3
conflictstyle = diff3
[diff]
guitool = meld
renames = copies
mnemonicPrefix = true
[difftool]
prompt = false
如何让git difftool
运行meld
?
最佳答案
注意:从 Git 2.22(2019 年第二季度)开始,{diff,merge}.{tool,guitool}
配置变量的组合以合理的顺序作为彼此的后备设置。
见 commit 6c22d71 , commit 7f978d7 , commit 60aced3 , commit 884630b , commit 05fb872 (2019 年 4 月 29 日)和 commit 57d93c1 , commit e9d309e (2019 年 4 月 24 日)作者:Denton Liu (Denton-L
) .
(由 Junio C Hamano -- gitster
-- merge 于 commit 85ac27e,2019 年 5 月 19 日)
在你的情况下,因为 difftool 没有定义:
difftool
: fallback onmerge.guitool
In git-difftool.txt, it says
'
git difftool
' falls back to 'git mergetool
' config variables when the difftool equivalents have not been defined.但是,当
diff.guitool
丢失时,它不会回退到 任何事物。当diff.guitool
是 git-difftool 回退到merge.guitool
不见了。
The documentation现在包括:
git difftool -g/--gui
When '
git difftool
' is invoked with the-g
or--gui
option, the default diff tool will be read from the configureddiff.guitool
variable instead ofdiff.tool
.
The--no-gui
option can be used to override this setting.If
diff.guitool
is not set, we will fallback in the order ofmerge.guitool
,diff.tool
,merge.tool
until a tool is found.
关于git - 如何在 git 中使用不同的 merge 和差异工具?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46218164/