-
Notifications
You must be signed in to change notification settings - Fork 11
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
WSL + Fork Tutorial #608
Comments
Since WSL is a virtual machine with a different file system, the majority of git operations will be very slow. |
That depends, in WSL v2, when you have your project content inside of the EXT4 volume, it's actually close to native speeds. It only becomes slow when you touch files outside of it since it has to translate everything to NTFS then. |
I'd love to have this working better. I'm still on WSL v1 iirc (last I checked v2 was beta or something and I didn't try it yet). I do all my command line stuff in WSL (using zsh as my default shell and runnig it in Hyper terminal. I have Hyper setup so it automatically starts wsl.exe and it opens my default shell (zsh). I have all the needed command line tools (git, build tools etc for frontend development) installed in WSL. VS Code has good integration for WSL and it can seamlessly work with projects that are either in normal NTFS partitions or in the WSL filesystem (using their official WSL "remote" plugin). First I tried having all my git repos in WSL too but I had problems and couldn't get Fork to work (at least some git operations were failing no matter how I tried configuring Fork). The best workaround I have found so far is to keep my git repositories under regular windows filesystem. I can still work on them in my terminal via WSL just using a path like But I'd like to keep the repos in WSL if Fork would work with that kind of setup. |
I also tried configuring "Integration / Shell / Custom" in Fork to make the "Console" button open Hyper, but I was not able to make it open Hyper terminal in the correct directory (where the selected repository is in). Not sure if the problem is with Hyper, my Hyper config or with Fork. So now I need to open my terminal manually and navigate to the correct directory instead of a convenient button to open directly from Fork. I used to work on macOS and there it was really nice that Fork could open iTerm in the correct dir just by clicking the Console button. |
This is probably a good start https://github.com/carlolars/wslgit/blob/fork-patch/README.md#usage-in-fork, currently not really working well for me though. Maybe @carlolars can provide input here? |
I can't say that I notice any difference in speed when using the bundled git compared to using wslgit. It must be slower yes, but it's far from very slow, not noticeable during daily use for me at least. I've used other git-GUIs that were slow for real, I was really pleased when I found Fork and paired it with wslgit. |
That will change come WLS2 though. You will want to move your files inside the container otherwise it's horribly slow. Talking 2min42s for a npm build here that inside of the container takes 15s. They do know about that limitation and are working on further improvements though. But it will launch this slow. |
Yes WSL2 will be slow I've heard, hopefully they will find a solution. I tried to open a repository in the WSL filesystem using the UNC path, ( |
Opening from |
I just did some testing on accessing the WSL1 filesystem from
And the numbers for accessing a repo on Windows filesystem:
The repo was cloned using wslgit so that is likely why Git for Windows was slower on the Windows fs, because of some attribute-mismatch or something. |
Yeah it's almost impossible to use :/ |
I'm using Fork on the exported \wsl$ directory and the speed is ok but I needed to set core.filemode=false. |
Perhaps it would be enough to use
|
But, I think that it would not be that hard for the Fork-team to implement support for WSL since they have full knowledge of all the arguments they pass, and knows when to expect paths that needs translation between Win<->WSL. Its just a matter of priority. |
I hope so as well, a git gui client is one of the last things preventing me to really like wsl |
Hey @DanPristupov any news here? Many apps, for example JetBrains, have now implemented native support for WSL Git, is this something you would want to do as well? |
We were planning to work on it, but then decided to add Pull Requests first (#984) :p. It's still in our todo list though. |
Awesome, thanks! |
Has there been any progress on this? I recently moved to WSL for most of my programming, and I'd really love a way to continue using Fork. |
The included WSL interop is still work in progress and you can find the latest build in the PR linked above. It still has a lot of problems so I would not suggest relying on it yet. |
I've had Fork working well with wslgit. See andy-5/wslgit#112 and other issues at the wslgit project site for some pointers. |
Any update on this? I'd love to be able to use Fork on my code hosted inside WSL2.... |
I got this working with the latest executable provided on #701 There is an icon showing which repos are in WSL: It's slow due to WSL2?, any suggestions for speed? |
@greenkalx show report from |
Attached Performance Benchmark of NTFS vs WSL2: benchmark01.txt I have seen suggestions to switch to WSL1, or run WSL2 on ext4 filesystem.
Microsoft suggest WSL1 for Performance across OS file systems: table of WSL versions |
That's very slow. It shows that the minimum request to WSL takes longer than 4 seconds. Do you use Fork-1.82.13-WSL.zip? It usually shows a better performance. Check Task Manager, what process uses most CPU during the benchmark? May be it's an antivirus.
I think WSL1 is kind of deprecated. |
I saw there were updates in Dec 2022 for 9P, with performance improvements. Tried updating the wsl kernel: But the speed got worse, from a score of 2.4 to 1.6. |
I thought to reboot Windows 11 host after the wsl kernel update, and the benchmark is much better! 26.1 on WSL2 repo 1 Suddenly it becomes workable. Still using the ForkWin-1.83.10-WSL.zip build. |
Installing wslgit was confusing, so I left this comment with what worked for me. Signing commits with 1Password doesn't work, even though it works inside WSL/Ubuntu. Has anyone else gotten commit signing to work? |
I got commit signing working, but I don't use 1Password with GIT/SSH. What I've used is SSH generated from within WSL2 and making that works on GIT CLI first, with check the github repo etc. |
Do you have something similar to this in your
|
Also, I don't think you will need "wslgit.zip" anymore. Make sure to install the normal Fork.app first then download the Fork-WSL (from this thread: #701 (comment)). |
Yup. The main difference that I can think of is I don't use 1Password SSH - I do use 1Password for password management. I had tried 1Password SSH once but it really fucked up my SSH access so much that I just gone back to tried-and-true way of simple SSH. |
Thank you for the help. I was able to get everything working by:
What is the proper way to "install" Fork-WSL, so I don't have to run it from my Downloads directory? |
What I did to finish is:
There are a lot of steps, and they don't provide a good user experience, so it would be nice if this could be simplified. |
This is my
As for the installation of the Fork.app, I installed the normal version on Windows 11, downloaded the WSL-forked version, extracted it a suitable location, make a shortcut of the Fork-WSL version, and that's it. As mentioned in previous post, I don't use 1Password for SSH and just use the WSL/Debian's ssh-agent. |
Fork-WSL only works if the location where the repo is cloned is the default WSL distro, otherwise shows a git not found error even though 'which git' shows it's installed. For example, after I installed docker, docker made the default distro docker-desktop. I had to set it back to Ubuntu before Fork-WSL started working again. 'wsl -l --all' can be used to see which is the default distro and 'wsl -s Ubuntu' fixed the issue for me. Fork-WSL should already know which distro is being used since the path begins with \wsl$<distro>... so this should be easy to fix in the next release. (Using core.fileMode=true since in some cases filemode might be changed intentionally and I need to keep track of this) |
I have been trying to get fork to work with my WSL instance. I am using Ubuntu 24.04 and the 2.3.20-WSL instance of fork. Fork is setup so that it is using the Fork git instance. As soon as I try to open up a git project in Fork that resides in WSL I get the following error fatal: not a git repository (or any parent up to mount point /mnt) I have multiple distros of WSL, but I 24.04 is the default instance (but not installed first). Any other ideas on what I could be doing wrong or missing would be greatly appreciated. |
FYI, I upgraded to the official release of v2.5.0.0 of Fork, which broke WSL Git. I had to add it again in the Fork settings. Is there anyone listening on the Fork team who can get a solution merged into Fork that doesn't require all these manual steps? This isn't very pleasant! @DanPristupov, are you on the team? |
@epicserve what are all the manual steps you need? Are you running the normal v2.5.0.0 of fork, or the special WSL2 build? |
If I recall correctly, with newer WSL2 build, you don't actually need this special wslgit anymore. At least I'm not using it anymore. |
Case in point, I mentioned this back in Jan 2025. |
|
I don't think this is accurate. I just tried it. I uninstalled Fork and deleted wslgit. Then I downloaded https://cdn.fork.dev/prerelease/Fork-2.3.20-WSL.zip. Also, I couldn't find anywhere that links to WSL releases, so I used this version. I would like to use a newer one but, I couldn't find one. After installing Fork-2.3.20-WSL.zip, it doesn't show any choice for a git instance. Also, it doesn't seem like I can upgrade it. It just freezes at 0%. |
I'm probably not the only one who wants to fully rely on WSL for any development work done on Windows. Yet, I still want to keep using Fork on Windows as my Git GUI of choice. Now, there are a few obstacles here but I think the community should come together and provide a tutorial for like minded people.
There are a few open issues that prevent a "perfect" flow:
wsl.exe
as terminal 64bit version? #385New things that might help:
Thoughts?
The text was updated successfully, but these errors were encountered: