How do you merge in GIT on Windows? How do you merge in GIT on Windows? windows windows

How do you merge in GIT on Windows?


I suggest kdiff3. Install it and put something like:

[merge]        tool = kdiff3[mergetool "kdiff3"]        path = c:/Program Files (x86)/KDiff3/kdiff3.exe[diff]        tool = kdiff3        guitool = kdiff3[difftool "kdiff3"]        path = c:/Program Files (x86)/KDiff3/kdiff3.exe

in your .gitconfig

To edit the global config (.gitconfig): git config --global --edit

The installation path on your machine may be different from c:/Program Files (x86)/KDiff3/kdiff3.exe. Replace that string above with actual path to your kdiff3 binary. And don't forget you have to use forward slashes, /, and not backward ones (\) like native programs usually do.


For me (windows xp, kdiff3 0.9.96 and git 1.7.5.1), Jan Hudec's answer did not work. Here is my setup:

[diff]        tool = kdiff3        guitool = kdiff3[difftool]        prompt = false[difftool "kdiff3"]        path = /home/username/bin/difftool-kdiff3.sh

and

#!/bin/sh# Passed the following parameters from git#  --auto --L1 "somefile (A)" --L2 "somefile (B)" /tmp/4VhUw0_somefile somefileLOCAL=$6REMOTE=$7"C:/Program Files/KDiff3/kdiff3.exe" $(cygpath -w "$LOCAL") "$REMOTE"