为什么我的difftool不再工作了?

时间:2018-04-23 14:38:06

标签: windows git git-difftool

它曾经工作但在更换我的笔记本电脑后,它不再被识别。任何帮助都非常感谢!

以下是我尝试使用Git Bash(git version 2.16.2.windows.1):

$ git config --list --show-origin
...
file:"C:\\Git\\mingw64/etc/gitconfig"   difftool.kdiff3.cmd='C:/Program Files/KDiff3/kdiff3' $LOCAL $REMOTE
file:"C:\\Git\\mingw64/etc/gitconfig"   difftool.kdiff3.keepbackup=false
file:"C:\\Git\\mingw64/etc/gitconfig"   difftool.kdiff3.trustexitcode=false
file:"C:\\Git\\mingw64/etc/gitconfig"   merge.conflictstyle=diff3
...

我复制了旧的工作配置文件。但那时:

$ git difftool master devSQC

This message is displayed because 'diff.tool' is not configured.
See 'git difftool --tool-help' or 'git help config' for more details.
'git difftool' will now attempt to use one of the following tools:
kompare emerge vimdiff
...

$ git difftool --tool-help
'git difftool --tool=<tool>' may be set to one of the following:
                vimdiff
                vimdiff2
                vimdiff3

        user-defined:
                kdiff3.cmd 'C:/Program Files/KDiff3/kdiff3' $LOCAL $REMOTE

The following tools are valid, but not currently available:
                araxis
                bc
                bc3
                codecompare
                deltawalker
                diffmerge
                diffuse
                ecmerge
                emerge
                examdiff
                gvimdiff
                gvimdiff2
                gvimdiff3
                kdiff3
                kompare
                meld
                opendiff
                p4merge
                tkdiff
                winmerge
                xxdiff

Some of the tools listed above only work in a windowed
environment. If run in a terminal-only session, they will fail.

$ git difftool -t=kdiff3 master devSQC

Viewing (1/61): '.gitignore'
Launch '_kdiff3' [Y/n]? y
Unknown merge tool _kdiff3
fatal: external diff died, stopping at .gitignore

1 个答案:

答案 0 :(得分:2)

您必须更改此行:

git difftool -t=kdiff3 master devSQC

通过:

git difftool -t kdiff3 master devSQC

或:

git difftool --tool=kdiff3 master devSQC

通常,像-t这样的短参数后面跟一个空格字符。 --tool等长选项后跟=。这是一种惯例。