如何配置 Git 以使用不同的工具来比较 .gitconfig 文件?
我的 .gitconfig 中有这个:
[diff]
tool = git-chdiff #also tried /bin/git-chdiff
它不起作用;它只是打开常规命令行差异。当我做的时候
export GIT_EXTERNAL_DIFF=git-chdiff
然后 git diff
将打开外部差异工具(所以我知道外部差异工具脚本工作正常)。我的 diff 工具的 .gitconfig 配置有问题吗?
最佳答案
另一种方法(从命令行):
git config --global diff.tool tkdiff
git config --global merge.tool tkdiff
git config --global --add difftool.prompt false
前两行会将 difftool 和 mergetool 设置为 tkdiff
- 根据您的喜好进行更改。第三行禁用烦人的提示,因此无论何时点击 git difftool
,它都会自动启动 difftool。
关于git - 使用 .gitconfig 配置差异工具,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6412516/