Skip to content

Instantly share code, notes, and snippets.

@dasgoll
Forked from smoll/USING-DIFFMERGE.md
Last active March 3, 2019 13:44
Show Gist options
  • Save dasgoll/8d01df4bf8257ff132b39ae9c1bd942e to your computer and use it in GitHub Desktop.
Save dasgoll/8d01df4bf8257ff132b39ae9c1bd942e to your computer and use it in GitHub Desktop.
Using DiffMerge as your git mergetool (for Mac OS X / macOS)

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

brew cask install diffmerge

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

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