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.19k stars 59 forks source link

wslgit add fails #62

Closed bondib closed 5 years ago

bondib commented 5 years ago

C:\Users\bondi\dev\WSIL\healthshield>wslgit.exe add -A -- c:\Users\bondi\dev\WSIL\healthshield\tasker\tasker\tasks\move_nodes.py

Results with:

fatal: /mnt/c/Users/bondi/dev/WSIL/healthshield/tasker/tasker/tasks/move_nodes.py: '/mnt/c/Users/bondi/dev/WSIL/healthshield/tasker/tasker/tasks/move_nodes.py' is outside repository

andy-5 commented 5 years ago

What is the output of wslgit.exe rev-parse --show-toplevel? This should print the root directory of the repository (I assume this would be c:\Users\bondi\dev\WSIL\healthshield).

bondib commented 5 years ago

The output is:

C:\Users\bondi\dev\WSIL\healthshield>C:\Users\bondi\dev\wslgit.exe rev-parse --show-toplevel

/c/Users/bondi/dev/WSIL/healthshield

andy-5 commented 5 years ago

Do you have any custom mount points configured, either via wsl.conf or for example in .bashrc?

Your problem looks like a duplicate of #42 or #60.

andy-5 commented 5 years ago

You could try the new experimental wslgit-mount-at-root.exe build from the latest release which should support your setup.

Can you please report back if this works for you?

pjnovas commented 5 years ago

That one worked for me, I had tried wslgit.exe (release 0.7.0) adding the environment variable WSLGIT_MOUNT_ROOT to / and it didn't work, then used wslgit-mount-at-root.exe and worked out

My VSCode:

Version: 1.36.1 (user setup)
Commit: 2213894ea0415ee8c85c5eea0d0ff81ecc191529
Date: 2019-07-08T22:59:35.033Z
Electron: 4.2.5
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Windows_NT x64 10.0.18362

Thanks!

andy-5 commented 5 years ago

Thanks for the feedback, great to hear that the special build from release 0.7.0 works for you.

The WSLGIT_MOUNT_ROOT environment variable was only recently added and will be available in the upcoming 0.8.0 release. You can get an alpha build here if you want to try it.