Skip to content

Instantly share code, notes, and snippets.

@truedat101
Forked from cmatskas/p4merge.md
Last active March 28, 2025 08:32
Show Gist options
  • Save truedat101/4120d7b379775f286c8013524de8053e to your computer and use it in GitHub Desktop.
Save truedat101/4120d7b379775f286c8013524de8053e to your computer and use it in GitHub Desktop.
Set up p4merge as the default merge and diff tool in Git (for mac os x, 2025)

Assuming that P4Merge was installed in the default location on Windows, i.e 'C:\Program Files\Perforce\p4merge.exe' then the following commands will configure p4merge as the default tool for both merge and diffs in Git

Set up commands

git config --global diff.tool p4merge
git config --global difftool.p4merge.path '/Applications/p4merge.app/Contents/MacOS/p4merge'
git config --global merge.tool p4merge
git config --global mergetool.p4merge.path '/Applications/p4merge.app/Contents/MacOS/p4merge'

You can launch p4merge from the command line:

git difftool
git mergtool

You can check if the configuration was done correctly by issuing the following command:

git config --global -l 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment