VScode使用git bash

164 阅读1分钟
  • 在设置中搜索shell:windows,在setting.json中编辑

image.png

  • 修改成以下配置
    {
    "workbench.iconTheme": "vscode-icons",
    "git.ignoreWindowsGit27Warning": true,
    "vsicons.dontShowNewVersionMessage": true,
    "terminal.integrated.profiles.windows": {
        "PowerShell": {
            "source": "PowerShell",
            "icon": "terminal-powershell"
        },
        "Command Prompt": {
            "path": [
                "${env:windir}\\Sysnative\\cmd.exe",
                "${env:windir}\\System32\\cmd.exe"
            ],
            "args": [],
            "icon": "terminal-cmd"
        },
        "Git-Bash": {
            // "source": "Git Bash"
            "path": "D:\\Program Files\\Git\\bin\\bash.exe", //本地git的安装路径
            "args": []
        },
        "Windows PowerShell": {
            "path": "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe"
        }
    },
    "terminal.integrated.defaultProfile.windows": "Git-Bash"
    

} ```

  • 重启打开终端