vscode window版本下配置git bash为vscode默认终端

987 阅读1分钟

需求场景

在vscode window版本中使用git的时候发现无法自动补全比如git checkout 命令 按tab无法补全分支名

解决方案

  1. 在用户配置的最外层加上下面2个配置项
    "terminal.integrated.profiles.windows": {
        "GitBash": {
            "path": "D:\\develop\\tool\\Git\\bin\\bash.exe", //注意是bash.exe而不是git-bash.exe
        }
    },
    "terminal.integrated.defaultProfile.windows": "GitBash"
  1. 重启vs code 生效

image.png