1.點擊左下角的齒輪,展開點擊設置
2.點擊該處,打開設置配置文件,在配置文件中,配置git的bash.exe的路徑

方法
參考官方文檔,修改配置文件,將下面的配置加到 setting.json文件。
"terminal.integrated.profiles.windows": {
"PowerShell -NoProfile": {
"source": "PowerShell",
"args": [
"-NoProfile"
]
},
"Git-Bash": {
"path": "D:\\Program Files\\Git\\bin\\bash.exe",
"args": []
}
},
"terminal.integrated.defaultProfile.windows": "Git-Bash",
注意:上面的配置是要加到配置的大括號里面的
注: 如不成功可采用如下配置:
vscode版本1.57.1 , 2021.6.28 可以使用這個, 地址修改自己的bash實際地址
{
"terminal.integrated.profiles.windows": {
"Command Prompt": {
"path": "D:\\install\\Git\\bin\\bash.exe",
"icon": "terminal-cmd"
}
},
"terminal.integrated.defaultProfile.windows": "Command Prompt",
}
評論區:解決第一次打開一直為powershell
"terminal.integrated.profiles.windows": {
"Git-Bash": {
"path": "C:\\Program Files\\Git\\bin\\bash.exe",
"args": []
},
"PowerShell -NoProfile": {
"source": "PowerShell",
"args": ["-NoProfile"]
}
},
把git bash放到上面,重啟vsc,第一次打開terminal是git bash了。版本1.60.0。[滑稽]