P4Merge integration

Perforce P4Merge is a great free diff and 3-way merge tool that has a very good visualization of differences and conflicts. In this post I'll show how to integrate it into 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

Open Explorer, right-click in any folder and choose TortoiseSVN -> Settings.

Open External Programs -> Diff Viewer section. Switch to the External in the first group box and enter in the edit box:

C:\Program Files\Perforce\p4merge.exe %base %mine

tortoisesvn-diff

Open External Programs -> Merge Tool section. Switch to the External and enter in the edit box:

C:\Program Files\Perforce\p4merge.exe %base %theirs %mine %merged

tortoisesvn-merge

Integration into TortoiseGit

Open Explorer, right-click in any folder and choose TortoiseGit -> Settings.

Open Diff Viewer section. Switch to the External in the first group box and enter in the edit box:

C:\Program Files\Perforce\p4merge.exe %base %mine

tortoisegit-diff

Open External Programs -> Merge Tool section. Switch to the External and enter in the edit box:

C:\Program Files\Perforce\p4merge.exe %base %theirs %mine %merged

tortoisegit-merge

Integration into Visual Studio with AnkhSVN plugin

Open Tools -> Options -> Source Control -> Subversion User Tools in the Visual Studio.

Enter in the External Diff Tool edit box:

C:\Program Files\Perforce\p4merge.exe $(Base) $(Mine)

Enter in the External Merge Tool edit box:

C:\Program Files\Perforce\p4merge.exe $(Base) $(Theirs) $(Mine) $(Merged)

visual-studio-settings

That's all. P4Merge will automatically appear when you merge or open file differences.