Skip to content

Instantly share code, notes, and snippets.

@kasimte
Forked from YanhaoYang/.gitconfig-for-diffmerge
Created October 29, 2020 05:18
Show Gist options
  • Select an option

  • Save kasimte/9af67b28638c975678bef36db495944a to your computer and use it in GitHub Desktop.

Select an option

Save kasimte/9af67b28638c975678bef36db495944a 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment