Setting up and using Meld as your git difftool and mergetool on a Mac

  1. Download the latest .dmg package for Mac from here: Meld for OSX

  2. Set meld as your git difftool/mergetool by editing your ~/.gitconfig and adding the following lines, as mentioned in the above link:

    [diff]
      tool = meld
    [difftool]
      prompt = false
    [difftool "meld"]
      trustExitCode = true
      cmd = open -W -a Meld --args \"$LOCAL\" \"$PWD/$REMOTE\"
    [merge]
      tool = meld
    [mergetool]
      prompt = false
    [mergetool "meld"]
      trustExitCode = true
      cmd = open -W -a Meld --args --auto-merge \"$PWD/$LOCAL\" \"$PWD/$BASE\" \"$PWD/$REMOTE\" --output=\"$PWD/$MERGED\"
    
  3. Use the git difftool command in your repo to compare and edit files between revisions.

Leave a Comment