Last Updated: February 25, 2016
·
9.876K
· mteece

KDiff3 on Windows as Git Merge Tool

You can add this to your global gitconfig:

[merge]
    tool = kdiff3
[mergetool "kdiff3"]
    cmd = \"C:\\\\Program Files\\\\KDiff3\\\\kdiff3\" $BASE $LOCAL $REMOTE -o $MERGED

Alternatively you can run these at the command line, that automate the above:

$ git config --global merge.tool kdiff3
$ git config --global mergetool.kdiff3.cmd '"C:\\Program Files (x86)\\KDiff3\\kdiff3" $BASE $LOCAL $REMOTE -o $MERGED'

Now you will be able to resolve your conflicts with kdiff3 or with the command line via

$ git mergetool

Tools like SourceTree should use the default mergetool for git.