Home » Git bash » Git Bash – what is it? And a few useful commands

Git Bash – what is it? And a few useful commands

By Emily

It’s such a strange name…. before you read any further, I’m presuming that you know what git is. So you know what the ‘git’ bit of the name stands for, but how about ‘bash’? Bash is an acronym for Bourne Again Shell. Huh? What’s a shell?! A shell is a terminal application that enables you to run commands on an operating system through text commands. There are no buttons or dropdown or any kind of graphical user interface in a ‘shell’ application, just a cursor and a bunch of pre-defined commands that you will need to know in order to use the shell application. Shell applications can be really daunting at first but once you understand a few things they become much more comfortable to use.

Download and install git bash

To get started you’ll need to install git bash but you may already have it installed and not realise it, as it comes as part of the package when you download git for windows from here.

install git bash

If you have git, then you have it already. To see if it is already installed, open command (Start btn > type Git ba….) and as you type, if it is already installed you will see a button appear which you can click to open it.

how to open Git bash
Click Start > start typing Git bash. If installed, you should see similar to this

What I like about using Git Bash

A few things I like about using Bash for all my git command line tasks are :

  1. The colour coding which makes it much easier to instantly see what’s what.
  2. The current branch indicator. In cmd you don’t get any info as to what your current branch is.
  3. Autocomplete. Total luxury compared to cmd! For instance when you switch to a different branch start typing the branch name and press tab, it will complete the name for you.

Git bash commands

Change directory – cd

List folders – ls

Show current directory – pwd

Change to home directory – cd ~

Set username – git config --global user.name "John Smith"

Set email – git config --global user.email "jsmith@youremail.com"

NOTE: If you want more info on using git config read my other posts to learn how to read the values from your git config file, and how to set values in the git config file.

In addition to these you can use all Git core commands – I find it so much easier using Bash than the Windows CMD terminal for any git command line tasks.

Read more in my post explaining in detail how to change directory, and another explaining how to change the display name that you see in the Bash window.