Posts Git-bash with vscode
Post
Cancel

Git-bash with vscode

Visual Studio Code logo with a plus sign followed by git logo

Intro

Git-bash is a Windows application that emulates a Linux shell experience, and comes obviously with git program. In this guide I’ll demonstrate how to modify vscode’s integrated terminal to set git-bash. However, this guide can also be used to set powershell as vscode’s integrated terminal, once vscode comes with cmd.exe by default on Windows.

Guide

  1. Install Git/Git Bash in your Windows;

  2. Open vscode and click: File > Preferences > Settings;

  3. In User Settings tab, select: Features and then Terminal;

  4. Search for the section named: Integrated > Shell: Windows and put the full path to git-bash executable, as it follows:

Setting git-bash executable path in vscode integrated terminalSetting git-bash executable path in vscode integrated terminal

Explaining what vscode does under the hood, if you open settings.json and manually edit it, you’ll see something like the following:

Integrated terminal configurationIntegrated terminal configuration

By setting this property, next time you open vscode’s integrated terminal, it will run git-bash instead of Windows’s cmd.

To set Powershell as integrated terminal, you just have to set Powershell full path in the same variable.

Hope it helps, see you soon!

This post is licensed under CC BY 4.0 by the author.