我使用的是 Linux Mint 17 64 位。刚刚清除git
并重新安装apt
。已删除~/.gitconfig
。我在所谓的全新安装后所做的唯一配置是(在存储库内)
git config diff.tool vimdiff
Run Code Online (Sandbox Code Playgroud)
然后我跑
git difftool HEAD:switch-monitor.sh master:switch-monitor.sh
Run Code Online (Sandbox Code Playgroud)
并得到
fatal: cannot exec 'git-difftool--helper': Bad address
external diff died, stopping at HEAD:switch-monitor.sh.
Run Code Online (Sandbox Code Playgroud)
因此,我删除了相关行.git/config
并再次尝试该命令,果然内置的基本git diff
工作正常。
我还尝试了本教程中的说明:http://technotales.wordpress.com/2009/05/17/git-diff-with-vimdiff/
这会导致略有不同但相似的错误。我将以下内容放入新的~/.gitconfig
[diff]
external = git_diff_wrapper
[pager]
diff =
Run Code Online (Sandbox Code Playgroud)
git_diff_wrapper
并在 my 上放置一个可执行文件PATH
,然后运行
git diff HEAD:switch-monitor.sh master:switch-monitor.sh
Run Code Online (Sandbox Code Playgroud)
并得到
fatal: cannot exec 'git_diff_wrapper': Bad address
external diff died, stopping at HEAD:switch-monitor.sh.
Run Code Online (Sandbox Code Playgroud)
不过好像和内容没什么关系git_diff_wrapper
。我放置了
git config diff.tool …
Run Code Online (Sandbox Code Playgroud)