我正在尝试让我的 cygwin git 安装与 kdiff3 一起使用。
我在这里遵循了 Noam Lewis 的说明:http: //noamlewis.wordpress.com/2011/03/22/how-to-use-kdiff3-as-a-difftool-mergetool-with-cygwin-git/
但它不起作用:(
跑步
git mergetool -t kdiff3
给出这个结果:
Normal merge conflict for ...
{local}: modified file
{remote}: modified file
Hit return to start merge resolution tool (kdiff3):
The merge tool kdiff3 is not available as '~/kdiff3.sh'
然而,运行
~/kdiff3.sh
按预期打开 kdiff3。
这是我的 .gitconfig:
[diff]
tool = kdiff3
[merge]
tool = kdiff3
[mergetool "kdiff3"]
path = ~/kdiff3.sh
keepBackup = false
trustExitCode = false
kdiff3.sh
#!/bin/sh
RESULT=""
for arg
do
if [[ "" != "$arg" ]] && [[ -e $arg ]];
then
OUT=`cygpath -wa $arg`
else
OUT=$arg
if [[ $arg == -* ]];
then
OUT=$arg
else
OUT="'$arg'"
fi
fi
RESULT=$RESULT" "$OUT
done
/cygdrive/c/Program\ Files\ \(x86\)/KDiff3/kdiff3.exe $RESULT