Skip to content

Instantly share code, notes, and snippets.

@retrofox
Created August 22, 2011 14:52
Show Gist options
  • Save retrofox/1162544 to your computer and use it in GitHub Desktop.
Save retrofox/1162544 to your computer and use it in GitHub Desktop.
function parse_git_branch_and_add_brackets {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\ \[\1\]/'
}
PS1="\h:\w\[\033[0;36m\]\$(parse_git_branch_and_add_brackets) \[\033[0m\]\$ "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment