# This PS1 snippet was adopted from code for MAC/BSD I saw from: http://allancraig.net/index.php?option=com_content&view=article&id=108:ps1-export-command-for-git&catid=45:general&Itemid=96 # I tweaked it to work on UBUNTU 11.04 & 11.10 plus made it mo' better # \[\e]0;\u@\h: # Various variables you might want for your PS1 prompt instead Time12h="\T" Time12a="\@" PathShort="\w" PathFull="\W" TitleBar='\[\033]0;\u@\h:\w\007\]' export PS1=$TitleBar$Cyan\\u@\\h$Color_Off'$(git branch &>/dev/null;\ if [ $? -eq 0 ]; then \ echo "$(echo `git status` | grep "nothing to commit" > /dev/null 2>&1; \ if [ "$?" -eq "0" ]; then \ # @4 - Clean repository - nothing to commit echo "'$IGreen'"$(__git_ps1 "(%s)"); \ else \ # @5 - Changes to working tree echo "'$IRed'"$(__git_ps1 "{%s}"); \ fi)'$Color_Off:$BYellow$PathShort$Color_Off'\$ "; \ else \ # @2 - Prompt when not in GIT repo echo ":'$PathShort$Color_Off'\$ "; \ fi)'