Conversation
|
Hey @schummar, thanks for wanting to contribute! I wanted to set some expectations here that we will have to have a thorough discussion internally before we can provide any feedback here and that might take a while. GitHub Desktop ships with a specific custom built version of Git because we have to be able to rely on specific features being present, localization being turned off, and specific formats of Git output that could (and do) change between versions etc. Outsourcing that to a Git version we don't have control over would be fragile at best and poses other questions around ensuring compatible versions of Git LFS being installed etc. We would likely want to run a specific dugite version within the WSL environment. I certainly empathize with the friction you're encountering running Desktop alongside a WSL environment and it's clear that you've done a thorough job of going through the codebase to create a comprehensive solution but I want to set reasonable expectations that we won't have a lot of time to get into reviewing and considering this work in the short term. |
|
@niik thanks for the reply. I didn't expect this to be quick. Of course this is a big decision and will take time, no worries. I made the Pull Request also as a POC. The existing discussions regarding WSL were mostly "use UNC paths, it's working fine" and some tweaks and workarounds to make it somewhat workable. But that approach is fundamentally flawed and another idea is needed. I wanted to show that running git withing WSL might be such an idea. WSL is such a big deal for developers using Windows, so it deserves first class support in tools. 😉 Your point about using a specific git version makes sense. I see no issue with using an embedded git version also for WSL as well. I'll try to include this in the Dugite PR. Whenever you had time to discuss it and if you decide that the solution has potential, I'll be happy to work with you to iron out the problems and make it production ready. |
I have updated the Dugite PR |
|
A little script for anyone who wants to try it out: git clone https://github.com/schummar/dugite.git
git clone https://github.com/schummar/desktop.git
cd dugite
git checkout origin/feature/wslGit
yarn
yarn build
yarn link
cd ../desktop
git checkout origin/feature/wslCompatibility
yarn
cd app
yarn link dugite
cd ..
yarn build:prod
|
|
I can't comment on the code because I'm unfamiliar with this repository, but I've been testing this and the user experience is vastly improved. Everything is working smoothly so far. |
|
I've encountered a problem where an error is caused triggering a pre-commit hook: Edit: This is an edge case where GitHub Desktop errors on the first commit installing git hooks. After committing using git in the terminal, the hooks get set up properly and then GitHub Desktop works correctly for subsequent commits. |
|
It seems that problem has been discussed a lot already in other issues quite a bit, so it's probably not connected to the WSL integration. See #10345 (comment). But if you can provide a repo that demonstrates the issue, I will have a look. |
|
what do we need to have this in the master branch? it's impossible to use github for desktop with a repo in WSL |
|
I've been using this branch. I do not use the main branch. Getting this merged into main branch is ideal so I can continue to get regular updates. |
I am currently waiting for feedback from the team. As @niik said, it can take some time. Maybe he can provide an update some time ;-) Btw. I merge the latest main/development branches from time to time, but be aware that using a build from this branch might be outdated and auto update can't work either. |
Should this be run in WSL or windows terminal? |
|
In Windows Terminal. |
|
I haven't looked at the details of this PR, but a good implementation for similar thing is to look at vscode. Actual vscode logic remains with vscode-server, and it's can run in any remote machine. Vscode is just the UI user interacts with. Github desktop could adopt a similar architure. Though realistically its seems kinda unfeasible considering desktop's team size / target audience. I've been using the shiftkey/desktop fork in wsl from the start of wsl2. It is my daily driver for software development. Needed some minor issue solving from time to time, but overall it just works. Especially after introduction of WSLg, using linux version of desktop just feels more realistic. |
How do I add a repository located on WSL? I'm unable to see WSL directories in the folder selector that pops up when I click "Browse". |
Yes, that would be a valid approach too. But a lot more effort, which is probably not needed for this use case.
That works generally, but I think the user experience is not optimal. WSLg windows are not as performant and seamless as native windows and if you work both on the Windows side and in WSL, you'd have to have the app installed twice. |
Showing the WSL drives in Explorer has been working occasionally for me, but it's indeed very flaky. What should always work is to put the path directly into the file picker's url. E.g. |
|
Is there any update on this? I'm using GitHub Desktop with a WSL mounted drive and every operation is way too slow, compared to non-WSL mounted drives. |
|
Hey @schummar 👋, thank you for your effort on this. I'm trying it out locally and I have this error Do you have any suggestions on what could be wrong on my side? 🤔 |
You also have to use the modified version of dugite. See my comment: #16378 (comment) |
|
Hey @schummar I removed everything and started over and I still have an issue it happens when I select any repository inside WSL2 |
|
You can open devtools with |
|
I found this #17362 and followed the instructions to remove all local files from the original installation. After that I'm not able to login with Github account, for some reason it ends up on this page for ever, the link is doing nothing. So I decided to skip the login, but still the application can't see the repositories on WSL for me. Those are the errors in console: |
|
Are you running GitHub Desktop from within WSL? It's not meant to be used like this. The idea behind the PR is, that you run the application in Windows and access WSL folders from there. If you want to run it in WSL directly, you can try this fork that is meant be run in Linux environments: https://github.com/shiftkey/desktop If that is not the case, can you enable "All levels" in the console? Maybe there are more hints about where it's going wrong there. |
|
No other information when all levels set. Yeah I run it from the Windows. But all other developing-related things I have in WSL, so maybe I'm missing some library or something, but I have no idea what. I guess you don't need to waste energy on this issue, I needed GUI only from time to time, when I worked with too many updated files, as I had the need today again and just bought GitKraken for one year. Hopefully, GitHub will integrate your solution till then ;-) |
|
Sent from my iPhone
|
I tried the latest update and it's not working (no ability to add repos via UI), so I reverted to the previous commit |
|
Thank you so much for this. I've just installed it and it's working perfectly. I find it very strange that the PR is already +2 years and almost every WSL user is reporting performance issues without receiving any response, meanwhile, the focus mostly seems to be on UI adjustments. By the way, I wonder if this branch can be updated to latest changes in main or it will stuck in the current version |
|
For anyone trying to use GitHub Desktop with WSL and tired of years of painful slowness, this is the solution. |
|
@SynthLuvr can you tell what version you are using? and what Linux distro ? it's now hardcoded to Ubuntu (will do fix it later) Please reply here, I've created an issue in the repo itself |
Does this also stay fast when on a repo thats on windows side? I have some repos on linux and some repos on windows. |
|
@kittenchilly I've just tested it, and yes, it should be as fast as normal |
Thanks, I will try this soon. Just a quick question - will this replacement |
@omzy Read the two comments above yours |
|
@omzy Yes it does work, no problem |
OK thanks. It didn't work for (I got the |
|
@omzy Sure very soon, can you paste the error logs ( |
|
I've been struggling with this for a while and ended up building a fork that fixes it: GithubDesktopWSL Think of it like the VS Code Remote WSL extension but for GitHub Desktop. It runs a small daemon inside WSL that handles git and file operations natively over TCP instead of going through 9P.
I went with a patch-based approach so it auto-syncs with upstream releases. You can just download the installer and try it, installs side-by-side with official Desktop. Would love if anyone here could give it a try and let me know how it goes! |
|
@aleixrodriala a fork is going to be harder to maintain. What's the advantage over using https://github.com/MiloudiMohamed/wsl-git-bridge ? So far this works very well |
Git-bridge spawns wsl.exe per command and adds 93mson each op, file operations like diffs, merge state and .gitignore still go through 9P with a git-only shim, and Desktop overwrites its bundled git.exe on every update, so you need to patch it every update. So basically native support for all WSL actions and automatic updates is what you get. I have also updated the README with a "Why a daemon and not a shim" section |





Together with desktop/dugite#532, this potentially closes
gitexecutable #14222Description
Depends on desktop/dugite#532. Together this will introduce compatibility with WSL. While you can just open a repository in WSL by entering its UNC path, this never worked right for me and many others. It suffers from
My suggestion to solve all this simple: Run git within WSL
wsl.exe -e git .... The most important part is contained in the Dugite pull request. Assuming that gets merged, this PR fixes a few edge cases connected to it and improves WSL compatibility in regards to external editors and shells byThere are certainly some things to be discussed and edge cases to be fixed. I'm happy to make adjustments based on your feedback and hope that you can see the advantage of taking this route.
Screenshots
Release notes