VS Code 终端设置为Git Bash

摘要:
1.打开设置:2.搜索并输入shell:windows,setting。json,编辑或直接打开设置json3。在json文件中配置默认配置。如果您的json配置文件不包含以下参数,请直接复制并获取相应的路径,并将其更改为您自己的本地{“workbench.icon”:“vscode icons”,“git.ignoreWindowsGit27Warning”:true,“vsicons.dontShowN

1、打开设置:

VS Code 终端设置为Git Bash第1张

2、搜索

输入shell:windowssetting.json中编辑

VS Code 终端设置为Git Bash第2张

或者直接打开设置json

VS Code 终端设置为Git Bash第3张

3、配置

json文件中默认配置
如果你的json配置文件中没有如下参数,直接复制拿走
对应路径改成自己本地即可

{
    "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"

        },
        "Windows PowerShell": {
            "path": "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe"
        }
    },
    "terminal.integrated.defaultProfile.windows": "Windows PowerShell"
}

修改成如下配置

{
    "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": "E:\Program Files\Git\bin\bash.exe" //设置并添加git-bash的local安装路径
        },
        "Windows PowerShell": {
            "path": "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe"
        }
    },
    "terminal.integrated.defaultProfile.windows": "Git Bash"
}

4、重启VS Code

可以看到默认打开Git Bash终端、也可选择其他终端
VS Code 终端设置为Git Bash第4张

免责声明:文章转载自《VS Code 终端设置为Git Bash》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇PHP中的全局变量global和$GLOBALS的区别Maven命令与pom文件常量下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

Cmder 配置 git bash

@ 目录 背景 撸起袖子加油干 成果(不是诸葛大力) 背景 最近在家办公,用着自己的windows,想要找一个好点的终端,发现被吹得很厉害的windows terminal可能并没有我想象的那么好,最终发现了一个叫做cmder的还是和mac的iterm2有点相似的呢。可是最近发现在mac中通过选择为shell格式的勉强可以用ls等命令,但是vim还...

gitlab介绍与操作

Gitlab GitLab 是利用 Ruby on Rails 一个开源的版本管理系统,实现一个自托管的 Git 项目仓库,可通过 Web 界面进行访问公开的或者私人项目。 与 Github 类似,GitLab 能够浏览源代码,管理缺陷和注释。可以管理团队对仓库的访 问,它非常易于浏览提交过的版本并提供一个文件历史库。团队成员可以利用内置的简单聊天程序(W...

git clone error:RPC failed; curl 18 transfer closed with outstanding read data remaining

git clone时报RPC failed; curl 18 transfer closed with outstanding read data remaining 错误 error: RPC failed; curl 18 transfer closed withoutstanding read data remaining fatal: The re...

Git配置可视化的diff 和merge工具

Windows下使用Git,msysgit是首选,但是msysgit的shell实在不给力,大小不能更改,字体难看。所以,在Windows下,在Cygwin下使用Git是个很不错的选择。 我们在提交代码前,或是合并代码,查看代码修改时,经常要diff一下看看都有哪些修改内容,diff的输出,晦涩难懂,修改多了的时候,简直像天书一样。Git 1.7以后,有了...

如何同步多个 git 远程仓库

日常需求 以前源码是托管在 github 的, 现在想要同步托管在 gitee, 一做备份分发, 二方便国内下载使用(网速可观), 三防特色墙... 方式一 使用 gitee 的强制同步 之前在 github 托管了这么一个项目 mirrors-in-china,后来国内出了 gitee, 那么想着把项目同步一份到 gitee, 方便大家查看...正巧 g...

PowerShell调用jira rest api实现对个人提交bug数的统计

通过PowerShell的invoke-webrequest和net.client联合实现个人指定项目jira提交数的统计,其中涉及到了JSON对象的提交,代码如下: $content = @{username='用户名';password='密码'} $JSON = $content|convertto-JSON -Compress $jiraUri...