Skip to content

Instantly share code, notes, and snippets.

@BenGitsCode
Forked from YanhaoYang/.gitconfig-for-diffmerge
Created February 16, 2017 15:16
Show Gist options
  • Save BenGitsCode/bd0708320e3d29e18ee71f9fb8bd1cc2 to your computer and use it in GitHub Desktop.
Save BenGitsCode/bd0708320e3d29e18ee71f9fb8bd1cc2 to your computer and use it in GitHub Desktop.
Using DiffMerge as your Git visual merge and diff tool on Mac
[diff]
tool = diffmerge
[difftool "diffmerge"]
cmd = diffmerge \"$LOCAL\" \"$REMOTE\"
[merge]
tool = diffmerge
[mergetool "diffmerge"]
cmd = "diffmerge --merge --result=\"$MERGED\" \"$LOCAL\" \"$(if test -f \"$BASE\"; then echo \"$BASE\"; else echo \"$LOCAL\"; fi)\" \"$REMOTE\""
trustExitCode = true
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
#!/bin/sh
## A little script to make it easier to launch DiffMerge from the command line.
## Install this script into a folder in your path, such as /usr/bin or /usr/local/bin.
##
## Version 3.3.0.1001
## Copyright (C) 2003-2009 SourceGear LLC. All Rights Reserved.
##############################################################################
## Change DIFFMERGE_PATH to point to where you installed DiffMerge
DIFFMERGE_PATH=/Volumes/App/Applications/DiffMerge.app
## The actual executable is hidden inside the .app bundle.
DIFFMERGE_EXE=${DIFFMERGE_PATH}/Contents/MacOS/DiffMerge
## Launch DiffMerge using the given command line arguments. Use --help for
## additional information or see the man page distributed along with this
## shell script.
exec ${DIFFMERGE_EXE} --nosplash "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment