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

1 more "not a git repository" #45

Closed stasyaner closed 5 years ago

stasyaner commented 5 years ago

Hello. Can't get it working. Tried setting WSLGIT_USE_INTERACTIVE_SHELL to false/0 but nothing. It works fine from just CMD, but not from vscode. Could you please help? Thank you.

Looking for git in: D:\docs\wslgit.exe
Using git To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

git version 2.17.1 from D:\docs\wslgit.exe
> git rev-parse --show-toplevel
> git config --get commit.template
Open repository: \To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

d:\docs\amedia
> git status -z -u
> git rev-parse --show-toplevel
fatal: not a git repository (or any parent up to mount point /mnt)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
andy-5 commented 5 years ago

You seem to get the additional output

To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

on every execution of wslgit. This prevents VS Code from correctly parsing the output of git.

I guess some bash startup file causes this. There is a discussion about this text on https://askubuntu.com/questions/22607 with a possible solution to remove it.

Does this fix it for you?

stasyaner commented 5 years ago

Oh, yeah. I should have guessed. Yeah, the resolution from that link helped. It's working fine now. Thank you a lot, @andy-5 !