Adding p4merge to mergetool in Git

So I needed to merge some stuff on BlazeRouter_S for my thesis work and since I’m using Git for software configuration management, I had to setup a worthy diff tool to help me resolve the conflicts I was experiencing in my repo. Follow the instructions below to setup p4merge for your own git install:

  1. Download The Perforce Visual Client (P4V) here –> http://www.perforce.com/downloads/complete_list
  2. Run the install and customize it so that all you’re really installing is the Visual Merge Tool (see figure).Customize Install
  3. Once the installation has completed, p4merge will be located under \Program Files\Perforce. No links are necessary as Windows will add p4merge to the global path.
  4. Start Git Bash from either your repository or from the Git program folder.
  5. At the prompt type in the following:

The first line sets the global path for all repositories to use the p4merge tool.

The second line assigns the necessary settings for the p4merge.exe tool. Here we want the  $BASE code as our reference to compare both the $LOCAL copy that you just edited/committed and are trying to push to the remote server where the $REMOTE copy resides. The $MERGED file is the final composition of your resolved conflicts that p4merge will display in it’s GUI.

In a subsequent post, I’ll go over the p4merge tool in detail. For now, this should get you up and running. Any problems? Leave me a comment.

kor

This entry was posted in Git HOWTO and tagged , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>