Post

GUI Merge Tool for Git on Windows

So Git doesn’t come with a GUI based merge tool out of the box, which is fine. It’s rather easy to configure Git to use a visual 3-way diff tool.  Here’s some tips on how to setup a GUI merge tool for Git on Windows.

Which one to choose?

Well, that’s a personal choice. Popular ones for Windows seems to be either kdiff3 or P4V visual client.

Here, I will go through the steps to setup the P4Merge: Visual Merge Tool.

First, download the client from Perforce download page.

Start the setup and select only the “Visual Merge Tool” feature:

[caption id=”attachment_600” align=”alignnone” width=”300”]Select the Visual Merge Tool feature](https://cdn.insomniacgeek.com/images/2013/05/P4V-Visual-Component-1.png) Select the Visual Merge Tool feature[/caption]

After the installation has finished, you will need to configure Git to use it. Open a Git bash and type in these two commands;

1
2
git config --global merge.tool p4merge
git config --global mergetool.p4merge.cmd '"c:\Program Files\Perforce\p4merge.exe" "$BASE" "$LOCAL" "$REMOTE" "$MERGED"'

That should do it. You can now do visual merging using:

1
git mergetool

You can also do visual diffs using:

1
git difftool
This post is licensed under CC BY 4.0 by the author.