Skip to content

Instantly share code, notes, and snippets.

@geronimod
Created May 4, 2016 14:36
Show Gist options
  • Save geronimod/6ea0302a7ad3c2a2df9c1a2aa402b0c8 to your computer and use it in GitHub Desktop.
Save geronimod/6ea0302a7ad3c2a2df9c1a2aa402b0c8 to your computer and use it in GitHub Desktop.
bash branch info
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1/"
}
export BRANCH_INFO='$(parse_git_branch)'
export CURRENT_BRANCH='$BRANCH_INFO'
export PS1="\[\033[00;32m\]\u\[\033[01m\]@\[\033[00;36m\]\h\[\033[01m\] \! \[\033[00;35m\]\w\[\033[00m\]\[\033[00m\] ($BRANCH_INFO)\$ "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment