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 2.4.8.0 (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?

Thanks!

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:

C:\Users\{USERNAME}\.gitconfig

 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
TAGS
Community showcase
Published in Sourcetree

Sourcetree for Windows - CVE-2019-11582 - Remote Code Execution vulnerability

A vulnerability has been published today in regards to Sourcetree for Windows.  The goal of this article is to give you a summary of information we have gathered from Atlassian Community as a st...

4,907 views 0 12
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