Skip to content

Instantly share code, notes, and snippets.

@petros
Created March 17, 2012 17:56
Show Gist options
  • Save petros/2063527 to your computer and use it in GitHub Desktop.
Save petros/2063527 to your computer and use it in GitHub Desktop.
Nice git aware bash prompt

Here is a nice addition to your .bash_profile, so as to have a cool git aware prompt:

export CLICOLOR=1
export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx
source ~/.git-completion.sh
PS1='\[\033[34m\]\W\[\033[0m\]$(__git_ps1 " (\[\033[35m\]%s\[\033[0m\])") \$ '
GIT_PS1_SHOWDIRTYSTATE=1
GIT_PS1_SHOWSTASHSTATE=1
GIT_PS1_SHOWUNTRACKEDFILES=1
GIT_PS1_SHOWUPSTREAM="auto"

.git-completion.sh can be found in the git repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment