Skip to content

Instantly share code, notes, and snippets.

@bitob
Created January 17, 2022 17:29
Show Gist options
  • Save bitob/10e55d1726acb5bbae32898abec7a951 to your computer and use it in GitHub Desktop.
Save bitob/10e55d1726acb5bbae32898abec7a951 to your computer and use it in GitHub Desktop.
Meld as Mergetool for Git

Config in ~/.gitconfig

Found this somewhere, but cannot remember where.

[merge]
    tool = meld
[mergetool "meld"]
    # Choose one of these 2 lines (not both!) explained below.
    cmd = meld "$LOCAL" "$MERGED" "$REMOTE" --output "$MERGED"
#    cmd = meld "$LOCAL" "$BASE" "$REMOTE" --output "$MERGED"

#    $LOCAL is the file in the current branch (e.g. master).
#    $REMOTE is the file in the branch being merged (e.g. branch_name).
#    $MERGED is the partially merged file with the merge conflict information in it.
#    $BASE is the shared commit ancestor of $LOCAL and $REMOTE, this is to say the file as it was when the branch containing $REMOTE was originally created.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment