Cygwin Git: The merge tool kdiff3 is not available
cygwin, git, kdiff3
Solution
The wrap shell script is not necessary. I'm using kdiff3 installed in windows and set its folder in path and git in cygwin. If you don't set path for kdiff3 you need to give the full path in cmd as `cmd = /cygdrive/c/apps/KDiff3/kdiff3 ...`
[diff]
tool = kdiff3
[merge]
tool = kdiff3
[difftool "kdiff3"]
cmd = kdiff3 \"$(cygpath -wla $LOCAL)\" \"$(cygpath -wla $REMOTE)\"
trustExitCode = false
[mergetool "kdiff3"]
cmd = kdiff3 \"$(cygpath -wla $BASE)\" \"$(cygpath -wla $LOCAL)\" \"$(cygpath -wla $REMOTE)\" -o \"$(cygpath -wla $MERGED)\"
keepBackup = false
trustExitCode = false
[mergetool]
prompt = false
[difftool]
prompt = false
Problem
I'm trying to get my cygwin git installation working with kdiff3. I followed Noam Lewis' instructions here: http://noamlewis.wordpress.com/2011/03/22/how-to-use-kdiff3-as-a-difftool-mergetool-with-cygwin-git/ But it's not working :( Running ``` git mergetool -t kdiff3 ``` Gives this result: ``` 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' ``` However, running ``` ~/kdiff3.sh ``` Opens kdiff3 as expected. Here's my .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 ```