Skip to content

Instantly share code, notes, and snippets.

@yfuruyama
Created June 9, 2013 14:05
Show Gist options
  • Save yfuruyama/5743666 to your computer and use it in GitHub Desktop.
Save yfuruyama/5743666 to your computer and use it in GitHub Desktop.
show git branch at bash prompt
showbranch='git br 2>&1 | ruby -ne "if /\* (.*)/ =~ \$_.chomp; print \$1; end"'
export PS1='$('"${showbranch}"')'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment