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

external diff stopped working

External diff stopped working recently for me.  I have beyond compare selected in source tree options, I've tried multiple, win merge, ... no difference.  I have "allow source tree to modify global git config" checked.

But I never see the .gitconfig file updated.  I've manually added diff tools to it and it works from command line.

[difftool "sourcetree"]
    cmd = 'C:\\Program Files\\Beyond Compare 4\\BCompare.exe' \"$LOCAL\" \"$REMOTE\"

I can see beyond compare making the call

git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks d
ifftool -y --tool=sourcetree raptor_kubedbg.xml                                 

I can manually run this and it works.  But when running from within sourcetree the process log shows

Unknown merge tool sourcetree
fatal: external diff died, stopping at rcs.raptor.player/Properties/launchSettings.json

I feel like the root of the issue is sourcetree is not writing to the global git config correctly, is it supposed to?

Any suggestions?  Running sourcetree version  3.0.17 beta 2660, was running 3.0.12 I think before this.


4 answers

2 accepted

0 votes
Answer accepted
bgannin Atlassian Team Jan 02, 2019

Hi Scott,

Beta discussions should be on the mailing list and bug reports can go in the bug tracker per the list intro.


Brian Ganninger
Senior Mac Developer, Sourcetree

I updated to the beta to see if it made any difference, it didn't. Using version 3.0.12 now and i'm seeing the issue.

0 votes
Answer accepted

I've tracked this down to the environment variables HOMEPATH and HOMEDRIVE being incorrect.  I can temporarily fix these and saving the diff app and doing the external diff work as expected.

Now to figure out why those values are incorrect.

One thing is running the same commands outside of sourcetree and they work.  But when running from within sourcetree they don't work, so sourcetree is passing those environment variables into git.

I had the same issue. I use Source Tree 3.1.2 on Windows 10 and want to use CompareIt as external diff tool.

When I set the path in Source Tree, I get the same "Unknown merge tool sourcetree" message in the process output window.

I have two gitconfig files on my PC:

  • c:\Users\<username>\.gitconfig
  • c:\Program Files\Git\mingw64\etc\gitconfig

I don't know where Source Tree keeps the 'Diff Command' settings, but it is not in these files above. When I manually add:

[difftool "sourcetree"]
cmd = 'c:/CompareIt/wincmp3.exe' $LOCAL $REMOTE

to the 2nd gitconfig file (program files/git..) external diff started to work as expected.

Ps: When I go back to Source Tree external diff settings and change the path to something else:

  • the new value is saved in Source Tree
  • gitconfig files are not updated
  • external diff still works with the path defined in 2nd gitconfig file (program files\git..)

I also had issues with SourceTree 3.1.2 on Windows 10. I had several lines like this :

    cmd = 'C:/Program

In section [difftool "sourcetree"] and [mergetool "sourcetree"] in the file  C:\Users\<username>\.gitconfig

After cleaning those lines, I was back to an expected behaviour.

This problem occurs on OSX (macos, mac) too. I'm using high sierra. The issue is ~/.gitconfig is not altered by SourceTree despite the Preferences/General setting, and this file is used even when using the embedded git.

I fixed the problem by modifying ~/.gitconfig for BeyondCompare per :


  tool = bcomp


  prompt = false

[difftool "sourcetree"]

  trustExitCode = true

  cmd = "/usr/local/bin/bcomp" \"$LOCAL\" \"$REMOTE\"

[difftool "bcomp"]

  trustExitCode = true

  cmd = "/usr/local/bin/bcomp" \"$LOCAL\" \"$REMOTE\"


  tool = bcomp


  prompt = false

[mergetool "bcomp"]

  trustExitCode = true

  cmd = "/usr/local/bin/bcomp" \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\"

[mergetool "soucetree"]

  trustExitCode = true

  cmd = "/usr/local/bin/bcomp" \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\"

Suggest an answer

Log in or Sign up to answer
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,917 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