1.點擊左下角的齒輪,展開點擊設置
2.搜索shell,找到Terminal ? Integrated ? Shell: Windows設置,進行編輯
3.在配置文件中,配置git的bash.exe的路徑
4.VSCode更新后,之前的配置會提示錯誤:
此項已棄用,配置默認 shell 的新推薦方法是在 `#terminal.integrated.profiles.windows#` 中創(chuàng)建一個終端配置文件,并將其配置文件名稱設置為 `#terminal.integrated.defaultProfile.windows#` 中的默認值。此操作當前將優(yōu)先于新的配置文件設置,但將來會發(fā)生更改。(2)
終端在 Windows 上使用的 shell 的路徑。詳細了解如何配置 shell。
5.ctrl+shift+p打開配置項,搜索setting.json將以下代碼添加
"terminal.integrated.profiles.windows": {
"PowerShell -NoProfile": {
"source": "PowerShell",
"args": [
"-NoProfile"
]
},
"Git-Bash": {
"path": "D:\\tools\\Git\\bin\\bash.exe",
"args": []
}
},
"terminal.integrated.defaultProfile.windows": "Git-Bash",
6.重啟vscode