Just a quick note for myself and for those of you who do coding and use bash: Do you you want to have a pretty and infromative prompt like:
Look for the place where your ~/.bashrc file establishes the value of the PS1 special environment variable, comment it out and put this in its place:
I hope the function names and color constants help you to understand what is going on and allow you to customize it to your own needs and taste.
Good night and happy hacking.
25 Nov 2010 (UPDATE):
I have edited parse_git_branch function as @mdias suggested