• window下Vscode配置 git 为终端


    找到配置文件

    首选项——>设置( Ctl + 直接到设置) ——>搜索配置shell.windows`

    在这里插入图片描述
    打开配置文件,进行修改


    修改配置

         官网:https://code.visualstudio.com/docs/terminal/basics#_configuration

         在vscode官方他说的是默认自己平台下的终端,window一般就两种 PowerShellcmd 我们可以自己配置来增加下面的内容

     "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": {
                "path": "你的git目录\\bin\\bash.exe"
            }
        },
        "terminal.integrated.automationShell.windows": "你的git目录\\bin\\bash.exe",
        "git.path": "你的git目录\bin\\git.exe",
        // 默认终端
        "terminal.integrated.defaultProfile.windows": "Git-Bash",
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21

    这就是我修改完成后的事例

    {
       //............
        "explorer.compactFolders": false,
        "workbench.tree.indent": 16,
        "terminal.integrated.automationProfile.windows": {
        
        },
        // 这里就是我们添加的配置,注意修改一下自己的Git文件地址
        "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": {
                "path": "D:\\_Porgram_IT\\Git\\bin\\bash.exe"
            }
        },
        "terminal.integrated.automationShell.windows": "D:\\_Porgram_IT\\Git\\bin\\bash.exe",
        "git.path": "D:\\_Porgram_IT\\Git\bin\\git.exe",
        // 默认终端
        "terminal.integrated.defaultProfile.windows": "Git-Bash",
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30

    完成后,我们可以检查一下,添加配置完成后,都会出现一个 defaultProfile.windows 在这里我们就可以查看我们的对应的终端
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述

    这里配置正确的话出来就直接是 Git-Bash


    总结

        只需要仔细一点,完全不会有问题,如果修改完成之后还是原来的 PowerShellCMD 我们只需要自己在修改一下下就行了或者重启都行

        在以后的项目中都会默认为我们修改之后的默认配置,也就是我们的git了
    在这里插入图片描述

  • 相关阅读:
    android--屏幕适配
    工单系统相关概念
    消息积压了如何处理?
    无人机技术服务应用
    第16集丨阳明心学&量子力学
    物通博联“5G+IIOT”构建污水处理物联网,助力远程监控智慧管理
    prompt第五讲-fewshot-selector
    【效率提升】手把手教你如何使用免费的 Amazon Code Whisperer 提升开发效率堪比 GitHub Copilot 平替
    项目经理的安全感——从项目监控过程中建立
    install flash_atten
  • 原文地址:https://blog.csdn.net/Bkhole/article/details/127661194