我想使用WSL(Windows上的Bash)Git和VSCode而不是Git for Windows来避免多个Git安装.
我创建了一个简单的bat脚本,git.exe通过重定向WSL中的git命令来模拟comportment.它在CMD中运行良好,但在VSCode中运行不正常.此外,WSL是我在VSCode中的默认终端.
VSCode settings.json:
{
"git.path": "D:\\tools\\git.bat",
"terminal.integrated.shell.windows": "C:\\Windows\\Sysnative\\bash.exe"
}
Run Code Online (Sandbox Code Playgroud)
和git.bat:
@echo off
bash -c 'git %*'
Run Code Online (Sandbox Code Playgroud)
有什么想让VSCode与WSL Git一起工作吗?