Using P4Merge with TortoiseGit

The team I’m currently working with uses Perforce as their versioning system. Personally I prefer Git over Perforce, but Perforce has a great merging/diff tool called P4Merge. Fortunately you can install P4Merge separately without the rest of the system. I mainly use the Bash and TortoiseGit when working with GIT , this article demonstrates how to integrate P4Merge with TortoiseGit.

Install P4Merge

P4Merge is included in the P4 Installer, when executing the installer you’re are able to install P4Merge only, you have to download the entire installer however. Follow these steps to install P4Merge:

Setup Diff Viewer with TortoiseGit

Follow these steps to setup P4Merge as the default diff viewer for TortoiseGit:

  • Open TortoiseGit->Settings from the Windows start menu
  • Choose ‘Diff Viewer’ from the settings tree
  • Choose to use an external tool instead of TortoiseMerge
  • Specify the following path and parameters: C:\Program Files\Perforce\P4Merge.exe %base %mine

Setup Merge Tool with TortoiseGit

Follow these steps to set P4Merge as the default merge tool for TortoiseGit:

  • Open TortoiseGit->Settings from the Windows start menu
  • Choose ‘Merge Tool’ under ‘Diff Viewer’ from the settings tree
  • Choose to use an external tool instead of TortoiseMerge
  • Specify the following path and parameters: C:\Program Files\Perforce\P4Merge.exe %base %theirs %mine %merged

Setup Bash

Integrating P4Merge with GIT from the Bash is explained in this answer on StackOverflow.

Share this article:

comments powered by Disqus