The easiest way to use Bash shell on Windows

The easiest way to use Bash shell on Windows

I want to use the bash shell on windows in place of the command prompt. I’ve tried the Linux subsystem for Windows and it’s not what I’m looking for and Cygwin just doesn’t feel right. My search led me to the Git Bash shell bundled with Git for Windows.

This article is about how to install git bash and customize it.

To clarify, the bash shell included in Git for Windows is actually mingw64. Mingw64 has a windows installer here but I really like the “Git Bash Here” shell extension you get when you install Git for Windows.

git bash here right click


How to Install Git Bash (Method 1 via choco)

  1. Install Chocolatey
  2. Open a privileged Command Prompt window
  3. Install Git for Windows using choco
    choco install git -y

or just Install Git for Windows (Method 2, traditional install)

  1. Navigate to gitforwindows.org
  2. Download and Run the Installer
  3. Make sure [*] Git Bash Here is checked
    git-for-windows-install-select-components

Launching Git Bash

From the Start Menu

  1. Click Start and type “bash”
  2. Click Git Bash
    launch_git_bash_start_menu

From Windows Explorer

  1. Open Windows Explorer
  2. Navigate to your target folder
  3. Right-click on the folder and choose “Git Bash Here”
    git bash here right click

From an existing Command Prompt window

For this method to work you must add C:\Program Files\Git\usr\bin to your PATH
From an command prompt just type bash

Customizing the bash prompt

The default prompt for Git Bash was a bit odd but you can change it just like on linux.

export PS1=”`pwd` #”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Ads Blocker Image Powered by Code Help Pro

πŸ™πŸ™A Humble Request to Disable AdBlock πŸ™πŸ™

You can close this message & continue reading but...
❀️❀️❀️ Please consider visiting one of my sponsors first ❀️❀️❀️

DigitalOcean πŸš€

Sign up and get a $200, 60-day credit to try DO.
Spend $25 after your credit expires and I will also get $25 in credit!
DigitalOcean Referral Badge

Pictory πŸ€–

Create amazing videos using Pictorys AI powered software.
Its FREE to create your first 3 video projects
pictory


Hi Reader, I noticed that you are using an ad blocker while visiting my website. While I completely understand that excessive ads can hinder your browsing experience, ad revenue helps pay for the cost associated with operating this website.

jcutrer.com is a labor of love, created with the primary aim to provide you with quality content, free of cost. It’s a space where I share information, ideas, and insights that I hope have a meaningful impact. However, maintaining and updating this platform incurs substantial costs.

Sincerely,
Jonathan