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

SourceTree can't find Git for Windows 2.3.4 (x86 and x64)

tkaw220 April 8, 2015

Git for Windows has recently updated to version 2.3.4. SourceTree couldn't find the newly installed Git for Windows 2.3.4 (both 32-bit and 64-bit). Any workaround?

12 answers

1 accepted

3 votes
Answer accepted
Christian Grasso April 11, 2015

A temporary fix for this is to create a symlink named "bin" in the Git directory that points to the cmd directory, where the Git executable is located in Git for Windows.

Open a command prompt (shift+right click, then Open command prompt here) in C:\Program Files\Git, and type this:

mklink /D bin cmd
tkaw220 April 13, 2015

This work!! Thanks Christian Grasso.

Nick Longin April 29, 2015

This allowed me back into SourceTree but the Terminal button no longer functions. It just momentarily flashes up a command prompt containing the error "'C:\Program' is not recognized as an internal or external command, operable program or batch file." Any idea how to fix the Terminal button as well?

Christian Grasso April 29, 2015

Probably a bug in SourceTree. It doesn't add quotes to the command so the prompt takes only the part before the space. Didn't test this, but a fix would be installing Git in a path without spaces, like C:\Git

Nick Longin April 29, 2015

Hmm, I was hopeful for a moment but that just produces a similar error saying "C:\Git\bin\sh.exe" is not recognized. sh.exe now seems to be in \usr\bin rather than \bin and since we're already symlinking \bin to \cmd we can't also symlink to \usr\bin. I tried copying everything from \usr\bin to \cmd which gets past the new error, but after that sh.exe just crashes and creates an "sh.exe.stackdump" file inside my repo. It's probably a SourceTree bug like you say, but it doesn't look like there's an easy workaround...

Christian Grasso April 29, 2015

Try adding \usr\bin to the PATH environment variable.

Nick Longin April 29, 2015

Adding to PATH doesn't seem to make any difference unfortunately. However, I did find https://jira.atlassian.com/browse/SRCTREEWIN-3174 which might be worth voting on...

Christian Grasso April 29, 2015

Another thing you might want to try is choosing "Use Git from the Windows Command Prompt" in the Git for Windows installer. That might make sh.exe available from cmd (can't test right now). By the way I upvoted that issue, but I think Atlassian will wait for a stable Git for Windows release.

Nick Longin April 29, 2015

I actually already installed Git that way. It doesn't seem to help with the problem directly, but it does mean you can uncheck "Use Git Bash as default terminal" in SourceTree's options. That way the Terminal button will just fire up cmd in the correct repo and Git commands will still be available without Git Bash. Might have to make do with that for the time being, or just start Git Bash via the context menu in Windows Explorer.

5 votes
patsissons August 26, 2015

The problem here is that the built-in bash profile (found at C:\Program Files\Git\etc\profile) expects a $MSYSTEM variable to be set to properly setup the $PATH variable. The default is to simply prepend the $MSYS2_PATH to $PATH. The problem is that this results in /bin lacking the git.exe executable. The best way to solve this is to edit C:\Program Files\Git\etc\profile and modify $MSYS2_PATH by appending :/cmd to  the end. This will allow both git-bash.exe and the sourcetree terminal to load the correct environment.

MSYS2_PATH="/usr/local/bin:/usr/bin:/bin:/cmd"
Jonathan Vannoy February 10, 2016

This worked for me.

1 vote
Silviu Burcea
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 8, 2015

Have you checked this page: https://confluence.atlassian.com/pages/viewpage.action?pageId=695108075 ? Check the git executable path when you're prompted. Another possible cause could be that Source Tree doesn't work with Git 2.x, but I don't know for sure about this one.

Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 8, 2015

Good resource. Also check your PATH to make sure your new Git version is there.

0 votes
Yiyang Fei November 6, 2019

I ran into this issue with SourceTree v3.2.6 and Git v2.24.0.2.  I used default settings when installing both applications.  Upon launching SourceTree, I was stuck in the popup window that says SourceTree can't find Git.  In my case, launching SourceTree with admin privileges "fixed" the problem, but I have no idea why.  Hopefully this note will help someone else.    

0 votes
Nick Longin June 22, 2015

The latest release candidate of Git for Windows has resolved this problem by adding some redirect executables to the /bin directory where SourceTree looks for Git. You need v2.4.4.2 RC3 or newer from https://github.com/git-for-windows/git/releases.

I believe Atlassian also have a fix in beta so that SourceTree looks in the proper /cmd directory.

0 votes
Pierre Garcia June 20, 2015

Thanks a lot, that link is not even on the first page of google search, it deserves more visibility! Try searching "git for windows" (without quotes), nothing... Cheers, P P.S.: SourceTree's internal link ("update embedded git") also points to version 1.9.5.

0 votes
Nick Longin June 20, 2015
0 votes
Pierre Garcia June 20, 2015

May I ask what you are refering to when you say "Git for Windows has recently updated to version 2.3.4"? At the moment the latest build I could find for windows was 1.9.5 and I'm quite interested to get a better version. Should I compile it myself? I'm not sure how to it properly... Thanks

0 votes
tkaw220 April 8, 2015

It is configured to use System Git.

0 votes
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 8, 2015

Ok, but that doesn't answer my question. "No" isn't a valid answer to "Embedded or System?" SourceTree only has those two options.

0 votes
tkaw220 April 8, 2015

No. I uninstalled the old 1.9.5, and then install 2.3.4. Upon starting SourceTree, it said it can't find Git.

0 votes
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 8, 2015

Is SourceTree configured to use Embedded Git or System Git?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events