P4Merge integration

Perforce P4Merge is a great free diff and 3-way merge tool that has very good visualization of differences and conflicts. In this post I’ll show how to integrate it to the popular clients of version control systems and to the Visual Studio.

It is assumed that the P4Merge is installed to the default path "C:\Program Files\Perforce".

Integration into TortoiseSVN

  1. Open Explorer, right click in any folder and choose TortoiseSVN -> Settings.
  2. Open External Programs -> Diff Viewer section. Switch to "External" in the first group box and enter "C:\Program Files\Perforce\p4merge.exe %base %mine" in the edit box.TortoiseSVN diff settings for P4Merge
  3. Open External Programs -> Merge Tool section. Switch to "External" and enter "C:\Program Files\Perforce\p4merge.exe %base %theirs %mine %merged" in the edit box.TortoiseSVN merge settings for P4Merge

Integration into TortoiseGit

  1. Open Explorer, right click in any folder and choose TortoiseGit -> Settings.
  2. Open Diff Viewer section. Switch to "External" in the first group box and enter "C:\Program Files\Perforce\p4merge.exe %base %mine" in the edit box.TortoiseGit diff settings for P4Merge
  3. Open External Programs -> Merge Tool section. Switch to "External" and enter "C:\Program Files\Perforce\p4merge.exe %base %theirs %mine %merged" in the edit box.TortoiseGit merge settings for P4Merge

Integration into Visual Studio with AnkhSVN plugin

  1. Open Tools -> Options -> Source Control -> Subversion User Tools in the Visual Studio.
  2. Enter "C:\Program Files\Perforce\p4merge.exe $(Base) $(Mine)" in the "External Diff Tool" edit box.
  3. Enter "C:\Program Files\Perforce\p4merge.exe $(Base) $(Theirs) $(Mine) $(Merged)" in the "External Merge Tool" edit box.Visual Studio AnkhSVN with P4Merge

That’s all. P4Merge tool will automatically appear when you merge or open differences.

2 thoughts on “P4Merge integration

  1. Really a great help… thank you.

    I have WinMerge in my file explorer shell… is there any way to replace it with p4merge? All is well with TortoiseSVN but now having seen a better way is there anyway to integrate this into the shell of a file explorer similar to how WinMerge works?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s