Thursday, April 16, 2015

Add git branch name to bash prompt

When working with git branches I found it helpful if the branch was displayed in my terminal itself rather than me having to cross check
In both the approaches all we have to do is add the piece of code to our .bashrc and source it.

Steps : 

  1. Open your .bashrc file with your favorite editor
  2. gedit ~/.bashrc
    
  3. Copy and paste code snippets of any one approach
  4. source the .bashrc file
  5. source ~/.bashrc