Set Git-Bash as Default Shell in Windows Terminal
Why Git Bash
- Both Command Prompt (CMD) and Unix (Bash) commands can be run in Git Bash.
- Small and Fast.
Prerequisites
Windows Terminal
Install Windows Terminal from the Microsoft Store.
Chocolatey
Chocolatey has the largest online registry of Windows packages. Installing Chocolatey
Git Bash
Easy way to install Git Bash via Chocolatey.
choco install git -y
Add Git Bash to Windows Terminal
Generate a new GUID
Run the following command in PowerShell.
[guid]::NewGuid()
- Added to Windows Terminal profile
Go to Windows Terminal settings via shortcut key
Ctrl + ,
{
"antialiasingMode": "cleartype",
"commandline": "%PROGRAMFILES%/Git/usr/bin/bash.exe -i -l",
"guid": "{f9934442-d71c-40b6-b804-717659fa8640}",
"historySize": 3000,
"icon": "%PROGRAMFILES%/Git/mingw64/share/git/git-for-windows.ico",
"name": "Git-Bash",
"startingDirectory": "%USERPROFILE%"
}
The GUID
f9934442-d71c-40b6-b804-717659fa8640
is previous command generated.
- Set “Git Bash” as the default terminal
Save the Settings.
Reference:
Generate a GUID in Windows 10 How to add Git Bash to Windows Terminal Windows Terminal’s 設定 Git Bash 和 SSH