How to show the Git branch in the Linux prompt

In pictures

How to go from this…

… to this?

Short answer

We will be changing your .bashrc file. It is located in your home.

  1. Make a save of your .bashrc file (one is never too careful; cp -p .bashrc .bashrc.sav).
  2. Optional step: make your prompt colored by uncommenting the highlighted line:

  1. Now locate the last line of the following excerpt and edit the previous lines accordingly to the following line:

  1. Restart your prompt, you’re done.

Something more detailed

Continue reading How to show the Git branch in the Linux prompt