configuring kdiff3 as a mergetool in msysgit

Tim Abell · September 3, 2010

How to configure kdiff3 as a mergetool in msysgit. (I think if you install kdiff3 before msysgit it is picked up automatically, if not, do the following after installing both).

In git bash:

<pre>git config --global merge.tool kdiff3
git config --global mergetool.kdiff3.path "c:\Program Files\KDiff3\kdiff3.exe"
</pre>

double check:
<pre>cat ~/.gitconfig
[merge]
tool = kdiff3
[mergetool "kdiff3"]
path = c:\\Program Files\\KDiff3\\kdiff3.exe
</pre>
refs:
<ul><li>http://markmail.org/message/dvrnn7ilprvinrfp#query:msysgit%20kdiff3%20.gitconfig+page:1+mid:dvrnn7ilprvinrfp+state:results</li><li>http://www.kernel.org/pub/software/scm/git/docs/git-config.html
</li></ul>

Under cygwin, the setup would be:
<pre>
git config --global merge.tool kdiff3
git config --global mergetool.kdiff3.path /cygdrive/c/Program\ Files\ \(x86\)/KDiff3/kdiff3.exe
</pre>
Giving the config file contents:
<pre>
[merge]
tool = kdiff3
[mergetool "kdiff3"]
path = /cygdrive/c/Program Files (x86)/KDiff3/kdiff3.exe
</pre>
Which by the way you can view with
<pre>
git config -e --global
</pre>

Share: Tweet | LinkedIn
Suggest improvments: page source on github