Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


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.


6 answers

2 accepted

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 think that Sourcetree assumes that %HOMEDRIVE%%HOMEPATH% points to your Windows user folder, where your .gitconfig file typically resides. But I think maybe they should have used %USERPROFILE% instead. My organization had set %HOMEDRIVE%%HOMEPATH% to a network drive location (probably via Active Directory), which caused this problem for me. My workaround was to remap my network drive to my home/user directory (since my organization has since quit using that mapped network drive anyways, but I didn't want to redefine those variables to be safe, since they were probably set by Active Directory). I remapped it in cmd with the command "subst [drive to map] %USERPROFILE%", then closed and re-opened Sourcetree, changed my diff/merge tool at that point, which successfully updated my .gitconfig (finally!). And then I also noticed that even after Sourcetree updated my .gitconfig, I still needed to keep that drive mapped (i.e. have homedrive/homepath point to my user folder) for the external diff/merge to continue to work.

Had this happen due to to the Active Directory being disconnected when VPN was down/rebooted machine. Clicked on drive in Windows Explorer, drive reconnected, diff tool now works again in Sourcetree and git-gui. 

0 votes
Answer accepted
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
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.

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.

Although I got it working for a 2019 release, external diffmerge has been broken for over a year now on macOS in subsequent releases. Some people use this tool contrary to what Atlassian thinks. It’s a nice product that generates no revenue. Please open source it and let someone else take it on. Most of us here pay quite a lot for JIRA every month. Give back to OSS.

I'm using Beyond Compare 4 and SourceTree 3.3.9 on Windows 10.

I had the same problem - no response after selecting External Diff from SourceTree.

By combining all the answers here, I found that the following lines in the file gitconfig make it work:

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

Note the usage of BComp.exe and the double backslash.

In SourceTree -> Options -> Diff, under "External Diff / Merge, I used the calling to the same .exe file. 

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
AUG Leaders

Atlassian Community Events