Git 使用 difftool 时抱怨没有这样的文件或目录

Git complains about no such file or directory when using difftool

我将 git 配置为使用 kdiff3,但似乎出现以下错误:

$ GIT_TRACE=1 git difftool
09:23:36.319531 git.c:419               trace: built-in: git difftool
09:23:36.321130 run-command.c:643       trace: run_command: GIT_EXTERNAL_DIFF=git-difftool--helper GIT_PAGER= git diff
09:23:36.322094 git.c:419               trace: built-in: git diff
09:23:36.340596 run-command.c:643       trace: run_command: GIT_DIFF_PATH_COUNTER=1 GIT_DIFF_PATH_TOTAL=3 git-difftool--helper init.el /tmp/LqOdEz_init.el 397ab56b39cf979c392c807c714cade1b949d1dd 100644 init.el 0000000000000000000000000000000000000000 100644
error: cannot run git-difftool--helper: No such file or directory
fatal: external diff died, stopping at init.el

我的配置是:

[diff]
    tool  = kdiff3
[difftool]
    prompt = false
[difftool "kdiff3"]
    cmd = kdiff3 "$LOCAL" "$REMOTE"

知道发生了什么事吗?我在 linux 如果这有所作为,我正在使用 git version 2.21.0

也许您需要在 PATH 变量上定义 kdiff3

我必须下载 this script 并将其放在我的路径中。