Skip to content

Use WSL Git as integrated VSCode Git #28315

@MarcAurel

Description

@MarcAurel

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions