Alexander Zeitler

No more leaky abstractions

Installing and configuring P4Merge for Git on Ubuntu

Geschrieben von Alexander Zeitler am 03. August 2014

Tags: englishp4mergegitubuntu

I’m using P4Merge as Git merge and diff tool on all platforms.
This post describes how to install it on Ubuntu.

In order to set up P4Merge on Ubuntu, copy the extracted P4Merge download to /opt/p4merge:

[~/Downloads/p4merge/p4v-2014.1.888424]$ sudo mv * /opt/p4merge

Then symlink p4merge:

sudo ln -s /opt/p4merge/bin/p4merge /usr/local/bin/p4merge

After that, add this to your ~/.gitconfig:

[merge]
    keepBackup = false;
    tool = p4merge
[mergetool]
    prompt = false
[mergetool "p4merge"]
    cmd = p4merge "$BASE" "$LOCAL" "$REMOTE" "$MERGED"
    keepTemporaries = false
    trustExitCode = false
    keepBackup = false
[diff]
    tool = p4merge
[difftool]
    prompt = false
[difftool "p4merge"]
    cmd = p4merge "$LOCAL" "$REMOTE"
    keepTemporaries = false
    trustExitCode = false
    keepBackup = false

Your next call of git difftool should look like this: P4Merge diff

blog comments powered by Disqus