vscode 怎样使用 bash on windows 上的git

Win10一周年更新版自带Linux子系统(Bash on Ubuntu on Windows),怎样使VSCode使用这个子系统里的git而不用额外安装Git for Windows

阅读 10.4k
1 个回答

文件 —— 首选项 —— 用户设置;

setting.json文件中设置

{
    "terminal.integrated.shell.windows": "C:\\Windows\\sysnative\\WindowsPowerShell\\v1.0\\powershell.exe"
}
// 64-bit cmd if available, otherwise 32-bit
"terminal.integrated.shell.windows": "C:\\Windows\\sysnative\\cmd.exe"
// 64-bit PowerShell if available, otherwise 32-bit
"terminal.integrated.shell.windows": "C:\\Windows\\sysnative\\WindowsPowerShell\\v1.0\\powershell.exe"
// Git Bash
"terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe"
// Bash on Ubuntu (on Windows)
"terminal.integrated.shell.windows": "C:\\Windows\\sysnative\\bash.exe"

官方文档说明:
https://code.visualstudio.com...