Ubuntu/Mint show git branch in terminal (bashrc edit)

I just wanted to share with you how my terminal looks like and how to export the PS1 variable.

To achieve it for Ubuntu: sudo gedit ~/.bashrc

For Linux Mint: sudo gedit /etc/bash.bashrc

And paste the following there at the line before the last one:

export PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w\[\033[01;33m\]$(__git_ps1)\[\033[01;34m\] \$\[\033[00m\] '

Here is a picture:
Screenshot from 2015-01-28 17:18:40

You may also like...