wslgit icon indicating copy to clipboard operation
wslgit copied to clipboard

Multiple WSL distro support

Open dixydo opened this issue 2 years ago • 4 comments

Hi! I have two Ubuntu WSL distro: Ubuntu and Ubuntu-20.04 for personal and working purposes respectively. I set git executable in PhpStorm as C:\Users\yevhe\bin\wslgit.exe and git integration works fine with Ubuntu, but not with Ubuntu-20.04. It returns error Error updating changes: not a git repository (or any of the parent directories): .git

Is it possible to get both of them working properly? If yes — how?

UPD: I have tried to download source code, replace Ubuntu-20.04 with Ubuntu and compile two different versions, but still no luck.

dixydo avatar May 03 '22 18:05 dixydo

wslgit uses the default WSL distribution, which you can set via wsl --set-default, see https://docs.microsoft.com/en-us/windows/wsl/basic-commands#set-default-linux-distribution .

There is currently no way to use wslgit with multiple distributions at the same time.

andy-5 avatar Jun 22 '22 12:06 andy-5

The problem is that wslgit always use the default wsl, so when accessing the filesystem from windows on another wsl instance the paths will translate to a Unix-path that exists on the other wsl instance, but wslgit will then run in the default instance where that path likely doesn't exist.

I'll push a PR soon that should make it possible to use wslgit with multiple distros, you just have to make sure git/ssh is setup correctly in all distros you intend to access repos in :)

carlolars avatar Jul 13 '22 19:07 carlolars

@dixydo There is now an alpha build available with the changes from @carlolars : https://ci.appveyor.com/project/andy-5/wslgit/build/artifacts

Does this work for your use case?

andy-5 avatar Jul 14 '22 10:07 andy-5

@andy-5 Thank you! Unfortunately I haven't possibility to test it right now as I'he already switched to single distro and route ssh config to repos manually to be able use your tool. I will try to test it on weekend.

dixydo avatar Jul 14 '22 10:07 dixydo

The changes have no been released as wslgit v1.2.0.

andy-5 avatar Dec 30 '22 06:12 andy-5