Skip to content

Instantly share code, notes, and snippets.

@codian
Created March 18, 2012 05:36
Show Gist options
  • Save codian/2069206 to your computer and use it in GitHub Desktop.
Save codian/2069206 to your computer and use it in GitHub Desktop.
current git branch name on prompt
export PS1="\[\033[34m\]\w\[\033[35m\]\`ruby -e \"print (%x{git branch 2> /dev/null}.split(/\n/).grep(/^\*/).first || '').gsub(/^\* (.+)$/, '(\1)')\"\`\[\033[00m\]> "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment