Skip to content

Instantly share code, notes, and snippets.

@tomravalde
Last active August 29, 2015 14:01
Show Gist options
  • Save tomravalde/05b986556f3595f08937 to your computer and use it in GitHub Desktop.
Save tomravalde/05b986556f3595f08937 to your computer and use it in GitHub Desktop.
Add to ~/.bashrc to display working directory and git branch at the prompt.
function parse_git_branch () {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
PS1="\u@\h \w\[\033[01;36m\] \W\[\033[0;33m\]\$(parse_git_branch)\[\033[0m\]\$ "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment