A Pretty Bash Prompt

I like my bash prompt to be a bit more informative than the defaults. It's always useful to know some extra information about what host you're connected to and what's going on in the directory that you're currently in. I also like to add additional colours to make the different parts of my prompt stand out.

To get a prompt like mine, you can use the following in your .bashrc or .profile:

source colors.bash
export PS1='\n\n\t \h $(YELLOW \u) $(RED $(__git_ps1 "[%s]"))\n$(CYAN \w)\n> '

This will give a prompt that looks like the following (assuming a black background with white text as default):

22:45:34 hostname username [branch]

You can download colors.bash from here.