Skip to content

Instantly share code, notes, and snippets.

@tobyontour
Created March 1, 2017 15:31
Show Gist options
  • Select an option

  • Save tobyontour/c2fe695f60cbb7190a77104a12459fe6 to your computer and use it in GitHub Desktop.

Select an option

Save tobyontour/c2fe695f60cbb7190a77104a12459fe6 to your computer and use it in GitHub Desktop.
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
PROMPT_DIRTRIM=1
export PS1="\[\033[32m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\] $ "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment