Download and install p4merge
- Download the Perforce Helix P4merge visual diff tool.
- Copy only
p4merge.app
into your /Applications/ directory
Setup p4merge as a visual mergetool
$ git config --global merge.tool p4mergetool
$ git config --global mergetool.p4mergetool.cmd \ "/Applications/p4merge.app/Contents/MacOS/p4merge \$PWD/\$BASE \$PWD/\$REMOTE \$PWD/\$LOCAL \$PWD/\$MERGED"
$ git config --global mergetool.p4mergetool.trustExitCode false
$ git config --global mergetool.keepBackup false
Using p4merge to resolve conflicts
When you run into a conflict when merging simply run:
$ git mergetool
- You will be prompted to run "p4mergetool", hit enter and the visual merge editor will launch.
- Using the merge tool you can resolve the conflict and then save the file.
- After you exit the next file with a merge conflict will open. Or it there are none, you will see the terminal.
You can also configure p4merge as a visual diff tool
git config --global diff.tool p4mergetool
git config --global difftool.p4mergetool.cmd \ "/Applications/p4merge.app/Contents/MacOS/p4merge \$LOCAL \$REMOTE"
Top comments (0)