Alias Bash inside Powershell
Jan 7, 2022
Windows is my daily driver and I quite like using Powershell. One thing I wish I could do was just type in bash
in the prompt and immediately switch over to Git Bash!
Instructions
Prerequisites: Make sure you have git-bash or another bash shell installed. You may have to update the executable path.
- Edit your Powershell profile and add the following line. You can find your profile location in the
$PROFILE
variable.function bash { & 'C:\Program Files\Git\bin\sh.exe' --login }
- Now every time you just type in
bash
your shell will super conveniently become bash!
Powershell may be powerful, but always need Bash at arms reach ;)