Live Fast, Code Hard, Die Young

Posts tagged ‘scc’

Using a cool merge tool with SVN or GIT

Here’s a little tip for those of you looking for a good diff/merge tool. It works quite well with both TortoiseSVN and Git Extensions and I’m sure it works with other applications as well.

Some of you may have heard of Perforce. It’s a pretty expensive source control system that is used by Google among others. I have never used it myself but I guess it’s ok. What I do know is that they have a great tool called P4Merge for merging and checking file differences. Best of all is that you can use it for free!

This is what a comparison looks like:

P4merge file comparison

Installing

To use P4Merge you need to install the Perforce Visual Client which is available as a free download from the Perforce download page. Make sure you get the right version for your system.

When you install it you can uncheck all the other tools and just install P4Merge:

P4merge installation

TortoiseSVN setup

To use P4Merge with TortoiseSVN you need open the TortoiseSVN settings and configure Diff Viewer and Merge Tool like this:

Diff Viewer:
“C:\Program Files\Perforce\p4merge.exe”  %base %mine

Merge Tool:
“C:\Program Files\Perforce\p4merge.exe” %base %theirs %mine %merged

Here’s how it looks for the Merge Tool setting:

TortoiseSVN settings

Git Extensions

It’s pretty easy to configure Git Extensions to use P4Merge. All you have to do is to open up the settings and choose “p4merge” in the Mergetool dropdown. The correct paths should be filled in automatically for you.

Git settings

That’s it – now you can enjoy a pretty nice tool for free!