You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Windows系统下Visual Studio Code一键打开Git Bash终端的方法

Windows下VSCode一键打开Git Bash终端的方法

方法一:绑定专属快捷键直接启动Git Bash

  • 按Ctrl+K Ctrl+S打开VSCode快捷键设置界面
  • 点击右上角的「打开键盘快捷方式(JSON)」图标(大括号样式)
  • 在keybindings.json中添加以下配置,可自定义快捷键组合:
{
    "key": "ctrl+shift+g", // 可替换为你习惯的快捷键,比如alt+g
    "command": "terminal.newWithProfile",
    "args": { "profileName": "Git Bash" }
}
  • 保存文件后,按下设置的快捷键即可直接打开Git Bash终端

方法二:将Git Bash设为默认终端,用通用快捷键启动

  • 打开VSCode终端面板(快捷键Ctrl+)
  • 点击终端面板右上角的下拉箭头,选择「选择默认配置文件」
  • 在弹出列表中选中「Git Bash」
  • 之后按下Ctrl+即可一键打开Git Bash,按Ctrl+Shift+可打开新的Git Bash终端

若找不到Git Bash配置文件的补充操作

如果VSCode终端列表里没有Git Bash选项,需手动添加配置:

  • 按Ctrl+,打开设置界面,搜索terminal.integrated.profiles.windows
  • 点击「编辑 in settings.json」,添加以下内容(注意修改Git安装路径为你实际的路径):
"terminal.integrated.profiles.windows": {
    "Git Bash": {
        "path": "C:\\Program Files\\Git\\bin\\bash.exe",
        "args": []
    }
},
"terminal.integrated.defaultProfile.windows": "Git Bash"

内容的提问来源于stack exchange,提问作者SIG4RT

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.16 20:12:33