How to add color and GIT Info to command line

If you are thinking, it would be nice to have some information about GIT when you are in one of the directory cloned from git repository, it’s possible and yes, it’s very useful.

This is how you do it.

add following to ~/.bashrc

export PS1=’\[\033[00m\]\u@\h\[\033[01;34m\] \[\033[00m\]\w \[\033[31m\]$(~/bin/vcprompt/vcprompt) \[\033[01;34m\]$\[\033[00m\] ‘
source /etc/bash_completion.d/git

This will show your terminal to look like this.

~/My/Project/Directory [git:Branch-Name?]

Where ‘Question Mark’ is for uncommited changes. So, it helps to show you which branch you are in + what is status of you local copy.

That is it.  Little things help to make you productive.

Note: Tested only in Ubuntu 11.10
This entry was posted in GIT and tagged . Bookmark the permalink.

Comments are closed.