Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
badges earned

Your Points Tracker
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to fix SourceTree's "External diff"? (no longer working)

Within the last week or two, SourceTree lost the ability to open the "External diff" tool: when I select External diff (or hit Ctrl-D), it no longer opens the external diff tool. Has anyone else seen this as well and/or does anyone have any pointers for how I might fix it?

I'm using Windows 10, SourceTree version (latest, last I checked), and Source Gear's DiffMerge tool (version 4.2.0, which is probably old). I can open DiffMerge directly, even from the command line. Example:
"C:\Program Files\SourceGear\Common\DiffMerge\sgdm.exe" local.env local.env.dist

SourceTree is configured to use DiffMerge as the External Diff Tool and as the Merge Tool.

I looked at this Atlassian Community question, but it really seems to be about a different issue. (SourceTree on my computer is already allowed to modify the global git config.)

I tried changing the External Diff option to Custom and manually selecting the DiffMerge executable (C:\Program Files\SourceGear\Common\DiffMerge\sgdm.exe), with or without quotes, and passing the $LOCAL and $REMOTE as the parameters in the Arguments field in SourceTree (with quotes and with backslash-escaped quotes).

Any ideas? Thanks.

1 answer

1 accepted

2 votes
Answer accepted
Mike Corsaro Atlassian Team Mar 28, 2018

Hello! Could you do the following:

  • Open the Process Viewer (Tools > Process Viewer...)
  • Run the external diff command
  • Check the process viewer output and see if a command is run that looks like this:
    • git {STUFF} difftool -y --tool=sourcetree {SHA}^..{ANOTHER SHA} -- {THE FILE}"
  • If that command is showing up, try and then run it from the command line (just hit the 'Terminal' button in Sourcetree and paste the command in. You can save the process viewer log and copy+paste from there)
  • If that command is not running, could you post what is?


Hi Mike,

Thanks for your input. Yes, that command is showing up. Example:

git -c diff.mnemonicprefix=false -c core.quotepath=false difftool -y --tool=sourcetree 5e3db38^..5e3db38 -- docker-compose.yml

And here's the output:

/mingw64/libexec/git-core/git-mergetool--lib: eval: line 124: unexpected EOF while looking for matching `''
/mingw64/libexec/git-core/git-mergetool--lib: eval: line 125: syntax error: unexpected end of file

Any ideas? Thanks again,

- Matt 

Mike Corsaro Atlassian Team Mar 28, 2018

Sounds like the git config is corrupt. Open this file:


 And look at the values under "difftool". Double check to see if there's anything odd, or if there's a missing ' or "

Like anders_melander likes this

Bingo! Sure enough, the difftool entry in the .gitconfig file had gotten corrupted somehow:

[difftool "sourcetree"]
cmd = 'C:/Program Files/SourceGear/Common/DiffMerge/sgdm.exe' \"$LOCAL\" \"$REMOTE\"
cmd = 'C:/Program
cmd = 'C:/Program
cmd = 'C:/Program
cmd = '/C:/Program

Removing all but the first entry there fixed the problem. Thank you! It's so nice to have my external diffs back.

Like anders_melander likes this

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Sourcetree

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

3,270 views 4 5
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you