Skip to content

Instantly share code, notes, and snippets.

@clintliang
Created July 6, 2017 00:25
Show Gist options
  • Save clintliang/03fbf0fe9183d5f3f37f58c956c8e29e to your computer and use it in GitHub Desktop.
Save clintliang/03fbf0fe9183d5f3f37f58c956c8e29e to your computer and use it in GitHub Desktop.
colorful bash path PS1 with git branch name
# path format
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\e[91m\u\e[33;40m@\H:\[\033[32m\]\w\[\033[36m\]\$(parse_git_branch)\[\033[00m\] $ "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment