Skip to content

Instantly share code, notes, and snippets.

@guylepage3
Last active June 21, 2018 13:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guylepage3/488ed1ce0bb23f161343180a3557fd3a to your computer and use it in GitHub Desktop.
Save guylepage3/488ed1ce0bb23f161343180a3557fd3a to your computer and use it in GitHub Desktop.
Bash alias Git branch and coloring
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\[\033[0;35m\]\t \[\033[0m\]\u \W\[\033[0;35m\]\$(parse_git_branch)\[\033[0m\] $ "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment