Skip to content

Instantly share code, notes, and snippets.

@luismayta
Forked from ppanyukov/gist:1035407
Created April 16, 2012 15:33
Show Gist options
  • Save luismayta/2399497 to your computer and use it in GitHub Desktop.
Save luismayta/2399497 to your computer and use it in GitHub Desktop.
Using p4merge with Git Mac OS X or Ubuntu

Git config

$ git config --global -e
[merge]
    keepBackup = false;
    tool = p4merge
[mergetool "p4merge"]
    cmd = p4merge "$BASE" "$REMOTE" "$LOCAL" "$MERGED"
    keepTemporaries = false
    trustExitCode = false
    keepBackup = false

p4merge Wrapper in search path

#!/usr/bin/env bash

for arg; do [[ $arg = /* ]] || arg=$PWD/$arg; absargs+=("$arg"); done;
/Applications/p4merge.app/Contents/Resources/launchp4merge "${absargs[@]}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment