-
打开你的git bash 终端
-
输入 where bash ,查看你的 bash 安装地址
3.打开你的 VSCode 的设置
4.在设置的 搜索框中输入:terminal.integrated.profiles.windows
5.点击下方的————“在 settings.json 中编辑”,进入到 settings.json 文件,
并在文件中插入如下字段:
"terminal.external.windowsExec": "这里 粘贴 你在第二步得到的 bash 安装地址!例如:C:/ruanjian/Git/bin/bash.exe",
"terminal.integrated.defaultProfile.windows": "Git-Bash",
"git.path": "粘贴 你在第二步得到的 bash 安装地址!末尾的bash.exe改为git.exe,例如:C:/ruanjian/Git/bin/git.exe",
"terminal.integrated.profiles.windows": {
"Git-Bash": {
"path": "这里 粘贴 你在第二步得到的 bash 安装地址!例如:C:/ruanjian/Git/bin/bash.exe",
"args": []
},
"PowerShell": {
"source": "PowerShell",
"args": []
}
}
- 最后,关闭当前【所有的】VSCode窗口(重要!!!),然后重启 VSCode 编辑器,打开终端查看是否生效