Skip to content

Instantly share code, notes, and snippets.

@ignaciojonas
Created November 11, 2014 01:38
Show Gist options
  • Save ignaciojonas/3244379cfcd9141b2967 to your computer and use it in GitHub Desktop.
Save ignaciojonas/3244379cfcd9141b2967 to your computer and use it in GitHub Desktop.
Branch name in the Ubuntu console
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
PS1="${debian_chroot:+($debian_chroot)}\u@\h:\w\\[\033[32m\]\$(parse_git_branch)\[\033[0m\]$ "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment