Skip to content

Instantly share code, notes, and snippets.

@henrik242
Last active January 5, 2023 22:23
Show Gist options
  • Save henrik242/1510148 to your computer and use it in GitHub Desktop.
Save henrik242/1510148 to your computer and use it in GitHub Desktop.
Helper script for p4merge and Git on MacOSX
  • Copy p4merge to /usr/local/bin/p4merge
  • Download P4V.dmg and copy P4Merge.app 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.
#!/bin/bash
for arg; do [[ $arg = /* ]] || arg=$PWD/$arg; absargs+=("$arg"); done;
/Applications/P4Merge.app/Contents/Resources/launchp4merge "${absargs[@]}"
@coolgo
Copy link

coolgo commented Oct 16, 2015

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

@max-lobur
Copy link

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