Skip to content

Instantly share code, notes, and snippets.

@davidchua
Created February 25, 2010 02:50
Show Gist options
  • Save davidchua/314174 to your computer and use it in GitHub Desktop.
Save davidchua/314174 to your computer and use it in GitHub Desktop.
# ~/.bashrc
# for git branch display on bash
# -- START ---
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
function proml {
PS1="\u@\h:\w\[\033[0;32m\]$(parse_git_branch)\[\033[0;0m\]> "
PS2='> '
PS4='+ '
}
PROMPT_COMMAND=proml
# --- END ----
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment