Conteúdo do item:

Adicionando o GIT BASH no VsCode

Como adicionar o GIT BASH no VsCode

Uso o Git Bash para poder usar os comandos do Linux no Windows, ele me ajuda na visualização de informações através das cores e também da branch ativa do meu projeto.
 
Quando instalei o VsCode 1.16 não veio configurado o GIT BASH e nesse caso tive que pesquisar uma maneira de inseri-lo.

Para fazer fiz os seguintes passos:

- Vamos abrir o terminar clicando em "View" -> "Terminal"
- Clique na "engrenagem" e em seguida em "Select Default Profile" , conforme na imagem abaixo



- Ao abrir a barra em cima, clique no icone "Pofiles Engrenagem", conforme a imagem abaixo.



- Digite "Bash" e tecle ENTER



- Agora vamos mudar a configuração do profile Bash criado.
- Clicando em "View" -> "Command Pallet" digite "Open Settings (Json)" ou "Open User Settings (Json)"  e tecle ENTER ou clique em "Open Setthings (Json)"
- Será aberto um JSON e aparecerá a configuração do Bash:
    "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"
        },
        "Bash": {
            "path": "C:\\Windows\\System32\\cmd.exe",
            "args": []
        }
    }


- Alterei o  atributo PATH do profile BASH para arquivo bash.exe ->  "path": "L:\\lucas\\apps\\git\\bin\\bash.exe"
- Adicionei o comando no final do JSON para deixar Default esse novo terminal -> "terminal.integrated.defaultProfile.windows": "Bash",
- Meu settings.json completo ficou assim :

{
    "javascript.updateImportsOnFileMove.enabled": "always",
    "explorer.confirmDragAndDrop": false,
    "editor.suggestSelection": "first",
    "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
    "files.exclude": {
        "**/.classpath": true,
        "**/.project": true,
        "**/.settings": true,
        "**/.factorypath": true
    },
    "files.encoding": "utf8",
    "workbench.colorCustomizations": {
        "debugConsole.infoForeground": "#ffffff",
        "debugConsole.warningForeground": "#ff8800",
        "debugConsole.errorForeground": "#ff0000",
        "debugConsole.sourceForeground": "#ffffff",
    },
    "redhat.telemetry.enabled": true,
    "workbench.colorTheme": "Visual Studio Dark",
    "java.configuration.runtimes": [
        {
            "name": "JavaSE-1.8",
            "path": "L:\\lucas\\apps\\java\\openjdk-8u41-b04-windows-i586-14_jan_2020\\java-se-8u41-ri",
        },
        {
            "name": "JavaSE-17",
            "path": "L:\\lucas\\apps\\java\\openjdk-17+35_windows-x64_bin\\jdk-17",
            "default": true
        }
    ],
    "java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx1G -Xms100m -javaagent:\"c:\\Users\\bloody\\.vscode\\extensions\\gabrielbb.vscode-lombok-1.0.1\\server\\lombok.jar\"",
    "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"
        },
        "Bash": {
            "path": "L:\\lucas\\apps\\git\\bin\\bash.exe",
            "args": []
        }
    },
    "terminal.integrated.defaultProfile.windows": "Bash",
}

- Resultado final, ao abrir o terminal apareceu um novo chamado "BASH"



vscode, visual studio code, bash, git-bash, criar, configurar, padrão, adicionar



Redirecionar para https://www.byiorio.com.br/product/3/item/14