How to set up free merge and diff tool (p4merge) for GIT

This is just a backup of this article as I found it very handy:

https://gist.github.com/SeanSSDing/d56d8b8aa4c79a05939b9ad3a6a63c8f

  1. Install p4merge from perforce.com
  2. Add below to your .gitconfig
[merge]
keepBackup = false
tool = p4merge
[mergetool “p4merge”]
cmd = /Applications/p4merge.app/Contents/Resources/launchp4merge “\”$PWD/$BASE\”” “\”$PWD/$REMOTE\”” “\”$PWD/$LOCAL\”” “\”$PWD/$MERGED\””
keepTemporaries = false
trustExitCode = false
keepBackup = false
[diff]
tool = p4merge
[difftool “p4merge”]
cmd = /Applications/p4merge.app/Contents/Resources/launchp4merge “\”$REMOTE\”” “\”$LOCAL\””
Categories: Git

Leave a Reply