can't clone from windows git to wsl

Viewed 623

I'm using github desktop with wsl-2. after some update of git & github desktop, when trying to clone a repo using git or github desktop I get "permissions denied", here are "censored" logs from github desktop:

2022-03-02T13:44:00.579Z - info: [ui] [AppStore.getAccountForRemoteURL] account found for remote: https://github.com/my_company/my_repo.git - username (has token)
2022-03-02T13:44:00.682Z - error: [ui] `git -c credential.helper= -c protocol.version=2 -c init.defaultBranch=master clone --recursive --progress -- https://github.com/my_company/my_repo.git \\wsl.localhost\Ubuntu\home\my_repo` exited with an unexpected code: 128.
stderr:
fatal: could not create work tree dir '\\wsl.localhost\Ubuntu\home\my_repo': Permission denied

(The error was parsed as 21: Permission denied.)

other git operations work, only this one doesn't. I ran chmod 777 on the relevant folder it did not help. please help, this is driving me crazy.

1 Answers

If you can install the latest GCM v2.0.692, this should be resolved with PR 612:

Update IsWslPath to detect \\wsl.localhost-style paths

Starting in Windows build 21354, the preferred WSL UNC file path is \\wsl.localhost\<distro>\ and not the older administrative-share style \\wsl$\<distro>\.

The older "wsl$" style will continue to be supported, but won't be the default type of path we'll see from the system going forwards.

We now support detecting both styles as WSL paths.

Related