Search code examples
gitcygwinkdiff3

KDiff3 under cygwin git will not invoke


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

Solution

  • 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.