DEV Community

Discussion on: How to make WSL2 even faster, with fast git

Collapse
 
edanb profile image
Edan Bainglass • Edited

I'm a bit confused about the script. My repository is located on /mnt/....

How would I create a link accessible from Windows to my repository? I'm confused about what "Code" refers to in the script. I attempted the following...

@echo off
START /B "" pushd \wsl$\Ubuntu\
rmdir link /s /q
mklink /d link target

where

link = the intended location of the link folder (in Windows)
target = Z:/mnt/... (location of my repository in wsl)

This creates the link, but the link produces an error (attached).

My general goal is to get access to my repository (Linux-based work), but have Git behave at a "normal" pace, as it does on Windows. If the above is aimed to achieve this, I would really appreciate an assist.

Thanks in advance...

Collapse
 
themartes_ profile image
Matej Bunček 🤔

Hi! I would really like to help you, but I'm not using windows anymore :(

Collapse
 
edanb profile image
Edan Bainglass

Does my "recipe" sound like it should achieve the goal though? I appear to be having the same issue as Nabeel below, where the symbolic link is not visible from the WSL side. Was that not your experience, or are we missing a step? If you don't remember, that's okay. I'll try to figure it out and post a solution.

Thread Thread
 
themartes_ profile image
Matej Bunček 🤔

Your solution looks good to me.

I asked my collegues if he was solving something like this, and he said he's using this script. It will run windows git under /mnt and linux git at other dirs. Meaning it will keep the speed of native git at all directories gist.github.com/jasonboukheir/3fda...

Thread Thread
 
edanb profile image
Edan Bainglass

Unfortunately, this does not seem to work either. Even after creating the script, typing git still defaults to linux git. It doesn't see my script. Can you please connect me with your colleague for further inquiry?

Thread Thread
 
edanb profile image
Edan Bainglass

Never mind... I just went with a simpler solution. Moved my project to the WSL filesystem (/home//project and lunched VS Code from there. I can now access it as if it was any other VS code workspace, but as it is now on the WSL filesystem, the default WSL git is at normal speed.

Thanks for everything :)