Skip to content

Instantly share code, notes, and snippets.

@domix
Created October 20, 2011 18:55
Show Gist options
  • Save domix/1301968 to your computer and use it in GitHub Desktop.
Save domix/1301968 to your computer and use it in GitHub Desktop.
My shell PS1 for displaying the current Git branch
export PS1="[\u@\h] \W \[\033[31m\]\`ruby -e \"print (%x{git branch 2> /dev/null}.grep(/^\*/).first || '').gsub(/^\* (.+)$/, '(\1) ')\"\`\[\033[00m\]$ "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment