I would like to use WSL (Bash for Windows) Git with VSCode instead of Git for Windows to avoid multiple Git installations.
I created a simple bat script to emulate git.exeby redirecting Git commands to WSL. It works fine in CMD, but not with VSCode. In addition, WSL is my default terminal in VSCode.
VSCode settings.json :
{
"git.path": "D:\\tools\\git.bat",
"terminal.integrated.shell.windows": "C:\\Windows\\Sysnative\\bash.exe"
}
and git.bat :
@echo off
bash -c 'git %*'
Any idea to get VSCode to work with WSL Git?
source
share