Skip to content

Instantly share code, notes, and snippets.

@mikebob
Forked from justintv/.bashrc
Created April 18, 2011 15:44
Show Gist options
  • Save mikebob/925579 to your computer and use it in GitHub Desktop.
Save mikebob/925579 to your computer and use it in GitHub Desktop.
export PS1="\u@\W[\$(git branch 2>/dev/null | grep '^*' | colrm 1 2)]: "
# For those of us who occasionally forget to change their branches
# This will change your prompt to display not only your working directory but also your current git branch, if you have one.
# Example
# user@directory[branch]:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment