Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Helper script for p4merge and Git on MacOSX
  • Copy p4merge to /usr/local/bin/p4merge
  • Download P4V.dmg and copy to /Applications
  • Configure Git:
$ chmod 755 /usr/local/bin/p4merge
$ git config --global merge.tool p4merge
$ git config --global mergetool.prompt false
$ git config --global mergetool.keepBackup false
$ git config --global mergetool.p4merge.path /usr/local/bin/p4merge
  • git mergetooland git difftool will launch p4merge now.
for arg; do [[ $arg = /* ]] || arg=$PWD/$arg; absargs+=("$arg"); done;
/Applications/ "${absargs[@]}"

Thanks @henrik242! I would never have figured this out on my own.

gpakosz commented Dec 29, 2014

I wrote wrapper scripts for Windows, Mac and Linux to iron out the integration of p4merge with git:

Hope that helps.

coolgo commented Oct 16, 2015

thank you for share,it's very useful for my problem with OS x EI caption

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment