

Git Bash is installed for you when you install Git for Windows, so if you're already using Git then you've kinda got this for free anyway. This is where Git Bash come to the rescue. Whilst there are times when I'll use WSL too, there are times when I want to be working 'in Windows' but using a more Bash-like experience. Git Bash is a 'Linux-like' shell experience without going 'all the way' and dropping into the Windows Subsystem of Linx (WSL) Bash shell. when assigning a variable like this):Įcho "source ~/bash_completion.d/docker" > ~/.bashrcĬurl -o ~/bash_completion.d/docker-machine Įcho "source ~/bash_completion.d/docker-machine" > ~/.bashrcĬurl -o ~/bash_completion.d/docker-compose Įcho "source ~/bash_completion.d/docker-compose" > ~/.bashrcĬoolness pt.2 - Using Git Bash as an Integrated Shell in VSCode ¶

when referencing a variable like this: $myVariable)īut there are some other things that differ (e.g. Boring option - Transposing between Bash and PowerShell ¶īash and PowerShell have some aspects of syntax in common (e.g. While these are usually pretty simple to transpose into something that could execute in PowerShell (see below) it's still annoying not to be able to copy-and-paste and execute the commands there and then or add them to a script file for future use without first translating them to PowerShell. Specifically, I do lots of things with tools such as Azure CLI and Kubectl (the CLI for Kubernetes) and the examples for these technologies often default to giving examples or scripts in Bash shell syntax. I often find code snippets for automating things in my world (mostly Azure Cloud admin and development) tend to assume that I'm using a Linux shell of some sort and so the commands and scripts are in Bash.

This article is about how to get a smooth experience for those times when I do find myself working in the Git Bash shell, as I'll explain below. So make no mistake, I'm not advocating using Git Bash all the time. I much prefer doing all my Git version control work in PowerShell with the very capable assistance of the posh-git Module. scoop install git) and therefore Git Bash is ready and waiting as the most obvious tool for using Git, I don't generally use Git Bash. For work unrelated to code or for more serious admin work I also tend to have a Windows Terminal open all day too.Įven though I have Git for Windows (i.e.

When I'm reading or editing code or scripts I primarily use Visual Studio Code, so I often use the integrated terminal there, and so my daily default is PowerShell Core there too. I'm primarily a Windows 10 user and I primarily use PowerShell as my day-to-day command shell ( Powershell Core 6.2.4 at time of writing).
