我正在使用带有默认 Ubuntu 12.04 软件包的 git:
git --version git 版本 1.7.9.5
我找不到任何机制可以让 git diff 打开外部差异工具,它似乎完全忽略了我使用的任何设置。 我终于尝试通过使用
git -c diff.external=/home/john/bin/git-meld diff --ext-diff
但这也没有用(仍在调用 diff --cc)
我也尝试了设置GIT_EXTERNAL_DIFF以及尝试 git diftool --tool=meld(这也奇怪地调用了 diff -cc)。 我完全不知道为什么我的比较工具设置被 git 忽略了。 我发现 diff -cc 输出难以理解,因为我已经使用 GUI 差异工具很长时间了。
我应该尝试更新到较新的 git 吗?
感谢您的任何帮助!John
我的 git 配置设置如下:
git config -l
user.name=jmicco user.email=parent.bank.app@gmail.com diff.external=/home/john/bin/git-meld diff.tool.external=/home/john/bin/git-meld core.editor=emacs core.repositoryformatversion=0 core.filemode=true core.bare=false core.logallrefupdates=true remote.origin.fetch=+refs/heads/:refs/remotes/origin/ remote.origin.fetch=refs/notes/:refs/notes/ remote.origin.url=ssh://jmicco@review.gerrithub.io:29418/jmicco/allowance-app remote.origin.pushurl=ssh://jmicco@review.gerrithub.io:29418/jmicco/allowance-app remote.origin.push=HEAD:refs/for/master branch.master.remote=origin 分支.主.合并=主 remote.gerrit.url=ssh://jmicco@review.gerrithub.io:29418/jmicco/allowance-app remote.gerrit.fetch=+refs/heads/:refs/remotes/gerrit/ remote.gerrit.fetch=refs/notes/:refs/notes/ remote.gerrit.pushurl=ssh://jmicco@review.gerrithub.io:29418/jmicco/allowance-app remote.gerrit.push=HEAD:refs/for/master gerrit.createchangeid=true
尝试:
GIT_EXTERNAL_DIFF="/bin/echo" git diff
它应该打印类似以下内容:
foo.c /tmp/T1NuN5_foo.c 240b63429c3267f8141ee0f33be9d12fc46216d3 100755 foo.c 0000000000000000000000000000000000000000 100755
然后你的 git 版本一切都很好。
diff.external=/home/john/bin/git-meld
是无效设置。Git 希望外部 diff 程序识别特定于 git 的参数并生成标准的差异输出。梅尔德不会那样做。
我认为你需要git difftool -t meld