Skip to content

Instantly share code, notes, and snippets.

@chinhodado
Created January 9, 2015 02:57
Show Gist options
  • Save chinhodado/6fc37def3e12ea09f785 to your computer and use it in GitHub Desktop.
Save chinhodado/6fc37def3e12ea09f785 to your computer and use it in GitHub Desktop.
How to use meld with Sourcetree on Windows
  • Install meld
  • Add location of meld.exe to the PATH, e.g. C:\Program Files (x86)\Meld
  • In SourceTree, go to Tools/Options/Diff
  • In External Diff Tool, choose Custom
  • Enter meld in Diff Command and $LOCAL $REMOTE in Arguments
  • Click Ok and restart SourceTree
@maxkoryukov
Copy link

Better to define $LOCAL $MERGED $REMOTE

In this case Meld will open mine file in the left tab, their - in the right, and the resulting file in the middle. It is very useful, since you could easy copy lines from left (mine) or right tab (their) to the result of merging.

@vadimnehta
Copy link

This breaks if the filepath has a space in it, and quotes don't seem to work - any ideas?

@fmuecke
Copy link

fmuecke commented Feb 29, 2016

using 8.3 file names did the trick for me.

@binarymelon
Copy link

Did this break for anyone else when moving to version 1.8 of sourcetree?

@Xytreyum
Copy link

Yep, the settings for this were removed - probably.

@gpgreenleaf
Copy link

gpgreenleaf commented May 16, 2017

This worked for me, but I had to type this for it to work instead of what was suggested: meld.exe

@jtreat3
Copy link

jtreat3 commented Jan 29, 2020

Step 2, what is the PATH? Is that a setting in Sourcetree?
I know the path to Meld.exe, I'm just not sure where I'm putting that info.

@samahudin
Copy link

This is how I have configured :

image

@davehague
Copy link

Just to add to the previous comments and question from @vadimnehta

You can add escaped quotes around the variables to handle files with spaces in the path or name.

\"$LOCAL\" \"$MERGED\" \"$REMOTE\"

image

@andrx
Copy link

andrx commented Aug 19, 2020

For Meld for OSX

Diff Command:
/Applications/Meld.app/Contents/MacOS/Meld

Diff Command Arguments:
$LOCAL $REMOTE

Merge Tool
/Applications/Meld.app/Contents/MacOS/Meld

Merge Tool Arguments:
--auto-merge $LOCAL $BASE $REMOTE --output=$MERGED

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment