Skip to content

Instantly share code, notes, and snippets.

@seaofclouds
Created November 11, 2008 17:22
Show Gist options
  • Save seaofclouds/23907 to your computer and use it in GitHub Desktop.
Save seaofclouds/23907 to your computer and use it in GitHub Desktop.
# get git branch name
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
# set prompt
PS1="\[\e[37;45;1m\][\u@\h]\[\e[0m\[\e[35m\] \w\$(parse_git_branch) #\[\e[0m\] "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment