andy-5 / wslgit

Use Git installed in Bash on Windows/Windows Subsystem for Linux (WSL) from Windows and Visual Studio Code (VSCode)
MIT License
1.18k stars 59 forks source link

Support for multiple WSL distros and using a wslgit default distro #129

Closed carlolars closed 1 year ago

carlolars commented 1 year ago

I use WSL2 for my main distro, but unfortunately I still have to do some stuff in the windows filesystem. So I set up a WSL1 running Alpine Linux and used git from within there. But my git GUI (Fork) was still using git from WSL2.

I then figured that it must be possible for wslgit to know if working in the windows filesystem or if working in a WSL2 filesystem and use the appropriate WSL distribution. It turns out that it was quite simple to detect when accessing files in a WSL filesystem using the UNC path and also to know which distribution must be used to access those files (solving #127?), and for all other paths use the default WSL distribution or a custom "wslgit" default distribution.

andy-5 commented 1 year ago

This is great! Thank you. I haven't tested it myself yet, but your changes look good, so I'll merge it right away.