Skip to content

Instantly share code, notes, and snippets.

@btv
Created April 20, 2011 20:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save btv/932742 to your computer and use it in GitHub Desktop.
Save btv/932742 to your computer and use it in GitHub Desktop.
Show git branch in bash prompt
# Show the git branch in the prompt
PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ '
#this also works for SVN version numbers & HG branches too.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment