Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use WSL Git as integrated VSCode Git #28315

Closed
MarcAurel opened this issue Jun 9, 2017 · 4 comments
Closed

Use WSL Git as integrated VSCode Git #28315

MarcAurel opened this issue Jun 9, 2017 · 4 comments
Assignees

Comments

@MarcAurel
Copy link

MarcAurel commented Jun 9, 2017

I would like to use WSL Git with VSCode instead of Git for Windows to avoid multiple Git installations.

WSL is my default terminal in VSCode, but the integrated Git in VSCode doesn't work with WSL out of the box. I tried to emulate the git.exe comportement with a simple bat file redirecting git commands in WSL. It works nicely in CMD, but not as the integrated Git in VSCode...

settings.json:

{
    "git.path": "D:\\tools\\git.bat",
    "terminal.integrated.shell.windows": "C:\\Windows\\Sysnative\\bash.exe"
}

git.bat:

@echo off
bash -c 'git %*'

Any idea to make VSCode integrated Git working with WSL Git ?

VSCode: 1.13.0
Windows: 10.15063.296
WSL: ubuntu 16.04
Git in WSL: 2.7.4

@CherryDT
Copy link

May I add that this can be relevant not only to avoid multiple installations and possibly keeping versions in sync but also when scripts are involved such as pre-commit hooks which do a npm run something.

We worked around this in am ugly way by having all npm scripts go through a special ensure_linux.js which invokes bash.exe instead of directly calling node if it detects that it's running from Windows.

@joaomoreno
Copy link
Member

#13138

@gdw2
Copy link

gdw2 commented Jul 27, 2017

@joaomoreno , is this really resolved? I've got WSL bash integrated, but git still doesn't work. Are the special steps to getting VSCode to recognize the WSL git?

@joaomoreno
Copy link
Member

@gdw2 #29812

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants