-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Is it possible to integrate GitHub Desktop inside WSL2 #13953
Comments
Hello @TonyTheFerg 👋 Yes, you can 😄 There are two ways to approach the problem. You can access the subsystem fs or use your windows fs in the subsystem. Access Subsystem FS
Use Windows FS from subsystem distro
cd /
cd mnt/
|
Actually it should be But cloning this way doesn't create repo in WSL properly. When you hit Open in Visual Studio Code you don't get typical linux project with WSL server installed for it, linux filesystem, linux shell and workspace path like |
This does not work on Windows. When i try to add the Repository with the path
i can see all file changes and the commit history properly.
Mapping the |
I have found a possible solution for this issue:
with the type The solution worked for me, as i can not execute Husky GitHooks from within GitHub Desktop. Hope this helps, |
The first method works, but given the WSL2 implementation, whenever you have to run pre-commit script (like husky), it doesn't work through Github desktop. It works through the WSL2 terminal though |
The first method does not work for me, I can't find the directory and also when I manually add the directory , I get the error fatal: could not create leading directories of '\wsl.localhost\Ubuntu-20.04\home\XXXX\XXXX': Permission denied Regards |
It would be awesome to have a real integration between github desktop and wsl2... |
I want to try to make a real integration happen. The basis for this is delegating git operations to git within WSL, which should solve some of the fundamental problems that come with the cross-filesystem workaround that people have been using. See desktop/dugite#532 I am awaiting feedback at the moment, so we'll have to see what concerns and edge cases come up with that solution. |
Any suggestions on how to solve authentication issues using Github Desktop with WSL2? I've installed it and added repos I already had cloned locally. But any attempt to fetch, etc, hits authentication errors (logs attached). I've set the ssh-agent running, and added my key (though no idea why it didn't find it, because it's in the default location with the default name and correct permissions). I've tried launching the github desktop .exe directly from the WSL2 terminal. I have signed out and back in again. I can fetch and so on fine from the WSL2 command line. Ideally I'd prefer Github Desktop to prompt for my SSH password each time. But for starters I'd just like it to work at all :) |
Very cool to see movement on this! I am running DDEV now, so I have become accustomed to their git integration UX, but this would still be a great feature! |
It's possible to use this Linux distribution of GitHub Desktop from inside WSL2 if you have setup support for WSL GUI apps. Here's what worked for me:
CaveatsI wasn't able to get the sign in to work (the redirect from the browser was not getting back to the app running in WSL). I was able to skip the sign in step, and use the app without the features that require sign in. |
The following comment helped me - basically you need to have a secondary ssh key set up on your Windows machine which can be set up using Git GUI: |
Just stumbled across this post. Thanks greatly for the tip. If you've got git on the command line, run git config --global core.autocrlf false to stop the conversion (use input rather than false if you need files converted on checkin because you're using a windows editor).
|
You know, with WSL2, you can simply install the Linux version of GitHub Desktop in your WSL2 Linux distribution. This works well if your repositories, Git config, etc. are in WSL2. No need to worry about line endings, directory paths, etc. It's all just natively in Linux with the GUI showing up like a Windows app. :-) https://github.com/shiftkey/desktop?tab=readme-ov-file#installation-via-package-manager |
Thanks for recomending this. it worked for me. I managed to sign in by installing google chrome browser in the distro as mentioned here. It won't open by default when click sign within github Desktop. So you must
|
Even though I mostly use Chrome in Windows I also installed the Chrome browser in Linux in WSL2. With Chrome installed in WSL2 as well I was able to do the normal sign in flow. |
for me, github desktop tries to convert line endings to CRLF in the diff when i try to do it like this |
This is annoying because GitHub Desktop shows no file changes, but my git in WSL shows every single line in every single file changed to CRLF. I wish there was and option for GitHub desktop to use WSL git or even better UI option to stop this from happening. But there is at least this solution: Add this to .gitconfig
You can edit your .gitconfig using or you can find it here
|
Describe the feature or problem you’d like to solve
More of a support request
Is it possible, and if so is there documentation on how to set up GitHub Desktop inside WSL2?
The text was updated successfully, but these errors were encountered: