git - 如何在 git 中使用不同的 merge 和差异工具?

标签 git diff git-diff mergetool difftool

我更喜欢使用 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 on merge.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 configured diff.guitool variable instead of diff.tool.
The --no-gui option can be used to override this setting.

If diff.guitool is not set, we will fallback in the order of merge.guitool, diff.tool, merge.tool until a tool is found.

关于git - 如何在 git 中使用不同的 merge 和差异工具?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46218164/

相关文章:

git - 如何在没有 --set-upstream 的情况下推送远程服务器上不存在的新分支?

git - 如何在 merge 分支 fork 的地方提交

Git diff 工具重置为 git default

任何存储库之外的自定义 2 文件的 git diff?

java - Java 中的 Git Diff 命令

git - 为什么要在 git 分支中使用 '--track' 选项?

linux - 源树差异摘要信息

Git 显示文件的最后更改

git - 什么是 `git diff --word-diff' 默认正则表达式?

diff - 如何在 GitLab 中默认为并排 View