Skip to content

Instantly share code, notes, and snippets.

@safchain
Created May 2, 2013 09:36
Show Gist options
  • Save safchain/5501197 to your computer and use it in GitHub Desktop.
Save safchain/5501197 to your computer and use it in GitHub Desktop.
Prompt with git branch
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
export PS1="\[\033[00m\]\u@\h\[\033[01;33m\] \w \[\033[31m\]\$(parse_git_branch)\[\033[00m\]$\[\033[00m\] "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment