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\] '

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s