문제

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
도움이 되었습니까?

해결책 2

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.

다른 팁

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
git config --global merge.tool kdiff3
git config --global mergetool.kdiff3.path "C:/Program Files/KDiff3/kdiff3.exe"
git config --global mergetool.kdiff3.keepbackup=false
git config --global mergetool.kdiff3.trustexitcode=false

please check config : git config --global -l

this work fine on cywin 64bit

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top