Skip to content

Instantly share code, notes, and snippets.

@smoll
Last active October 21, 2023 23:37
  • Star 40 You must be signed in to star a gist
  • Fork 15 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Using DiffMerge as your git mergetool (for Mac OS X / macOS)

Using DiffMerge as your git mergetool (for Mac OS X / macOS)

Reference(s):

Step 1: download and install the DiffMerge OS X Installer

http://www.sourcegear.com/diffmerge/downloads.php - get the installer version, NOT the dmg version

Step 2: configure it

git config --global diff.tool diffmerge
git config --global difftool.diffmerge.cmd 'diffmerge "$LOCAL" "$REMOTE"'
git config --global merge.tool diffmerge
git config --global mergetool.diffmerge.cmd 'diffmerge --merge --result="$MERGED" "$LOCAL" "$(if test -f "$BASE"; then echo "$BASE"; else echo "$LOCAL"; fi)" "$REMOTE"'
git config --global mergetool.diffmerge.trustExitCode true
git config --global mergetool.keepBackup false

Step 3: use it

Any time you encounter a merge conflict, just do git mergetool

@devshok
Copy link

devshok commented Dec 16, 2020

Via brew installing of diffmerge looks simple:
brew install --cask diffmerge

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