I just wanted to share my quick and dirty bash prompt, with Git support (sort of). I wanted to have a nice clean look, with the ability to show whether my cwd is a Git directory (or a child of one) or not. I didn’t care much about whether the directory was dirty or clean, or any other options, so I went with this option:
And this allowed me to get the effect I was looking for, without errors (if it was not in a Git directory) and a nice clean look.
Note: This works only with 256 color terminals, as I use some of those colors.