Skip to content

Instantly share code, notes, and snippets.

@jgeewax
Created August 20, 2010 23:23
Show Gist options
  • Save jgeewax/541406 to your computer and use it in GitHub Desktop.
Save jgeewax/541406 to your computer and use it in GitHub Desktop.
# Git stuff:
function get_repository {
pwd | grep $HOME'/workspace/.*/src.*' | awk -F/ '{print "("$5")"}'
}
function get_branch {
git branch 2> /dev/null | grep \* | awk '{print "("$2")"}'
}
# Update PS1
PS1="\[\033[01;34m\]\$(get_repository)\[\033[31m\]\$(get_branch)\[\033[37m\]\[\033[00m\]\[\033[38m\]\u@\h:\w$ "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment