In keeping with a number of solutions posted on the internet I have installed KDiff3 and modified .gitconfig as below to make use of it. Nonetheless, when I run git diff HEAD^ HEAD within a repository to test it I get a diff performed by the default tool. I'm running cygwin git on Windows7-64. Can anyone explain why KDiff3 is not invoked?
[diff]
tool = kdiff3
[merge]
tool = kdiff3
[difftool "kdiff3"]
path = \"D:/Program Files (x86)/KDiff3/kdiff3.exe\"
keepBackup = false
trustExitCode = false
[mergetool "kdiff3"]
path = \"D:/Program Files (x86)/KDiff3/kdiff3.exe\"
keepBackup = false
trustExitCode = false
Actually, the wrapper script is not needed. If kdiff3.exe is not in your path, you need to give the full path in cmd as cmd = /cygdrive/c/apps/KDiff3/kdiff3 ...
My .gitconfit
[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
Use git difftool to invoke the configured diff tool, not git diff.
Since you seem to be using cygwin git, but a native kdiff3, you'll probably also need to invoke a wrapper script, rather than kdiff3 directly, to use cygpath convert paths from cygwin form to native form.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With