-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doesn't work with SourceTree #61
Comments
Without more information, it is hard to say what exactly is not working. Is there any way you could get a log of the git commands SourceTree is trying to execute? At least, there seems to be a log file according to the documentation. Does |
Here is a sample log entry.
wslgit.exe work fines properly directly, but not when used with SourceTree |
@VarunAgw
|
After update windows 10 to 1903. It works like a charm. |
Just to clarify, this issue is caused by SourceTree not able to find the Git binary. It is not necessary to move your If you are not presented with a prompt, just start SourceTree without Git support and do the following:
Happy coding 👋 Edit: Added screenshot for clarity |
So this is still an issue. As of now with SourceTree 3.1.3 and the latest version of WSL Git, if you try to redirect the path to wslgit.exe (or even if it is renamed to git.exe, you get the following: And the program freezes and you have to kill it. If you try doing a fresh install, this same thing also happens on the "Install" part if you have the environmental variable set to the path. So I am assuming that SourceTree now doesn't like wslgit.exe at all. I can't see to use them together. I had to download GitKraken, which doesn't seem to have any issues at all. SourceTree is just my preferred GUI and I wish I could get it to work. |
That's too bad. Can you maybe try the latest changes of If it does not work, can you please provide the contents of the log file (see above)? |
@andy-5 - I reinstalled SourceTree and tried to pick the git.exe (renamed from wslgit.exe) as the default git client and it just froze the installation process. I had to kill SourceTree with the Task Manager. I then tried the install again and selected the embedded git option. Then once SourceTree was installed I then went to the options and tried to change from embedded to system, selected the git.exe in the correct directory and SourceTree froze again. The only thing in the sourcetree.log file was this:
I also checked the settings.log file and the last entry was:
So I am not getting any errors in the SourceTree logs. Something else I am noticing is this alpha version does not work with Visual Code Insiders either. The only thing in the output there is So this alpha version breaks any integration with Visual Code. And GitLens doesn't work with the stable or alpha version. |
I switched back to 0.7.0 and now Visual Code Insiders works fine, except for Git History or GitLens. SourceTree still freezes and has nothing in the logs. |
Thanks for the update. Getting no errors makes it very hard to fix, as I've got no idea what the actual problem is. I'll re-open this issue to keep track of it, though. Also, thanks for the heads-up regarding VS Code Insiders. I don't currently have an Insiders installation, but the alpha still works for stable VS Code for me, so there seem to be some recent changes to Git in VS Code. Good to keep in mind. |
I also just tried 0.7.0 and that did not work for me either. For some reason, SourceTree does not like wslgit executable even when you directly point at it, or if you manually replace embedded version executables with this one |
I have @charlwillia6 @adrach have you updated git in WSL? The Ubuntu 18.04 repository has a very old git, v2.7-something I think. To get later versions of git you must add a new ppa (source: https://launchpad.net/~git-core/+archive/ubuntu/ppa):
|
@carlolars ~ I downloaded the most current "alpha" version of wslgit.exe that I could find (0.8.0 alpha V4) which is here: https://ci.appveyor.com/project/andy-5/wslgit/build/artifacts as of 9/30/2019 I also have Git upgraded already on WSL by using the git-core PPA that you have posted and the version of Git that is installed is 2.23.0. So I do definitely have the most current stable version installed. VSCode-Insiders does not seem to work with wslgit 0.8.0 alpha-4. VSCode-Insiders complains that "No source control providers registered." I have renamed wslgit.exe to git.exe in my Git/bin directory. If I run Git: Show Git Output, I get I use the Insiders version because of certain compatibilities that are needed for some updated extensions and for also working with the most recent enhancements to WSL 2 and the WSL Remote extensions. I already tried VSCode Stable before and it wasn't working for me with the alpha build then and I don't want to keep installing it just to test it if it isn't going to work with SourceTree anyways. I also still cannot get SourceTree version 3.2.6 to work with this alpha version of wslgit.exe either. I have tried a clean install several times with files for Atlassian deleted from the AppData directory. If I open cmd.exe and check the git version there the output does say So my conclusion is that SourceTree does not work with the v0.7.0 or 0.8.0 alpha-4, and VSCode - Insiders does not work with 0.8.0 alpha-4. |
@carlolars and @andy-5 ~ I decided to download VSCode 64-bit Stable (v1.38.1) and it too gets stuck at:
Is this exe corrupt maybe? I even checked if this was a permission issue or something and both my 0.7.0 version and 0.8.0-alpha4 have the exact same permissions. 0.8.0-alpha4 will just simply not work unless it is directly from the command line. |
@charlwillia6 Just to make sure, when you run something like If there is any additional output besides the git version, e.g. a message from your shell or something similar, VS Code and SourceTree will not correctly recognize the output of git. Also, have you maybe changed your shell in WSL? There were some issues in the past when another shell than bash was executed. |
@andy-5 ~
I have not changed my shell. Nothing is different in my WSL besides running an update on Git, and running a update on Ubuntu itself. |
Eclipse IDE is also another program that is not compatible with wslgit. Just throwing that out there. |
For the record, I previously had issues getting this to work with sourcetree and WSL2, but I just tried again today and it seems to be working perfectly (sourcetree 3.3.8, libgit2 disabled, windows 19569). The only issue I ran into is that sourcetree requires git.exe to be inside a To fix this, I had to move wslgit to |
Great, thanks for the feedback. The next release, currently in development in the |
I confirm this is now working in SourceTree 3.3.8. However, I didn't change my folder structure, I always had git.exe and wslgit.exe in a bin folder. So, the updated version of SourceTree must be compatible with WSLGit now. I also disabled the libgit2, and everything seems to be working. |
I spoke too soon. While SourceTree works somewhat with WSLGit, it breaks other things like SourceTree's ability to use OpenSSH, or even Pageant to check SSH keys with git repositories. While this isn't a problem with WSLGit and more of a problem with SourceTree just not being compatible with WSL in general, getting WSLGit to work with SourceTree doesn't fix all the other issues that are going to happen because of the ssh-agent issues that will follow. Remote links are broken on some of my projects too. If you decide to just use HTTPS and never use ssh for authentication then SourceTree "kind of works". I also had to get the authentication working on the WSL side because adding your credentials in SourceTree just doesn't work. So, after configuring your credential.helper store in WSL(Ubuntu, or whatever), then saving your Bitbucket or GitHub credentials, only then will SourceTree play nice. Also, when you open a terminal from SourceTree it will just be a normal Windows cmd.exe terminal. You would still need to activate/run wsl.exe after launching. There are no terminal configurations in SourceTree. There really is too many issues with trying to get SourceTree to work as a decent client with WSL, and getting it to be compatible with Git is just the first annoyance. |
This solved my error(but first what happend): I installed Win Service Open-SSH-Client and added the ssh-agent to the system like this (all in Powershell (admin)): |
Here is what works for me:
Notes:
|
Does the Source Tree work for anyone here? Does anyone manage to solve the issue? |
I tried the steps from #61 (comment) to no avail in SourceTree 3.4.16 with Ubuntu 22.04.3 LTS, Git 2.34.1, and WSL 2 with this version info:
It appears that SourceTree's embedded Git installs Portable Git under
Of those, SourceTree only seems to care about the first one (under With SourceTree running I was briefly able to force SourceTree to use WSLGit by doing the following:
This worked for a single session, but as soon I restarted SourceTree, it wanted to reinstall embedded Git again. I did notice the following errors in
|
Okay, I take it back -- I found a workaround, but this feels brittle and hackish:
DO NOT replace any other copies of I figured this out by realizing that the file size of I have further confirmed that the Linux version is being used by enabling Versions ReportedAdding to the weirdness, SourceTree appears to get the version information about Git from the digital signature rather than by running Before Version SwapHere are the versions reported of everything BEFORE I swapped the MingW Git for WSLGit:
After Version SwapAnd here's what gets reported afterwards:
|
Regarding the issues mentioned about using this with Pageant, I use the wsl2-ssh-pageant adapter, which, despite not being maintained in the last two years and having several reports in its issue queue from users who say it stopped working for them, is still working for me even on Windows 11 version 10.0.22631 build 22631. I have been using the WSL2 Pageant since 2022 since it works with SSH and Git from within WSL. I have the binary installed in my Windows home folder under
As long as I start at least one Ubuntu terminal in my Windows session, WSL can use credentials from PuTTY's Pageant agent. |
@GuyPaddock Glad you got it working, and thanks for sharing your solution. I wonder why SourceTree does not pick it up from other locations (as described by others above), and you were forced to replace its internal Git executable. But it's good that you've at least found some solution. |
@andy-5 My speculation is that it's doing digital signature checking to ensure that it's only running a command it recognizes. But, since this is an Atlassian product, they only implemented 50% of the solution and aren't checking the signature of the underlying chain-loaded Git executable 🙄 |
The text was updated successfully, but these errors were encountered: