Skip to content

Instantly share code, notes, and snippets.

@ilyagr
Forked from amiryal/git config
Created February 10, 2023 05:25
Show Gist options
  • Save ilyagr/096d16d6cdf81c5adb7f640378d15f48 to your computer and use it in GitHub Desktop.
Save ilyagr/096d16d6cdf81c5adb7f640378d15f48 to your computer and use it in GitHub Desktop.
Easily visualise Git merge.conflictstyle diff3 with meld, while preserving all information
[merge]
conflictstyle = diff3
tool = three_meld
[mergetool "three_meld"]
# Opens up four diff windows:
# LOCAL:MERGED, BASE:LOCAL, BASE:REMOTE, LOCAL:REMOTE
#
# Lets you edit the MERGED file (including original diff3 markers), showing
# you the final diff from LOCAL. For reference, you can look in the other
# windows to see how LOCAL and REMOTE are each different from BASE, as well
# as the dumb diff between LOCAL and REMOTE.
cmd = "env LOCAL=\"$LOCAL\" REMOTE=\"$REMOTE\" BASE=\"$BASE\" MERGED=\"$MERGED\" bash -c 'meld --diff \"$LOCAL\" \"$MERGED\" --diff \"$BASE\" \"$LOCAL\" --diff \"$BASE\" \"$REMOTE\" --diff \"$LOCAL\" \"$REMOTE\"'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment