Useful Git Prompt
Here’s a snippet of bash script that I wrote to make my prompt tell me when I’m in a git repository and what branch I’m on. And to my pleasant surprise, the PROMPT_COMMAND mechanism will respect color codes, so if you have your branch listings in git colorized, it will be reflected in your prompt. [...]