Skip to content

Instantly share code, notes, and snippets.

@timoschilling
Created May 12, 2011 12:16
Show Gist options
  • Save timoschilling/968398 to your computer and use it in GitHub Desktop.
Save timoschilling/968398 to your computer and use it in GitHub Desktop.
git branch bash prompt, (c) by https://github.com/janv
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/[\1]/'
}
export PS1="\[\e[0m\]\w\[\e[0m\]\$(parse_git_branch) \$ "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment