Skip to content

Instantly share code, notes, and snippets.

@brodock
Created March 23, 2010 18:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brodock/341501 to your computer and use it in GitHub Desktop.
Save brodock/341501 to your computer and use it in GitHub Desktop.
Git branch on Shell
# colocar no ~/.profile
# Git Branch
function parse_git_branch {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1) /'
}
GREEN="\[\e[0;32m\]"
YELLOW="\[\e[0;33m\]"
NC="\[\e[0m\]"
PS1="\u@\h:\W $YELLOW\$(parse_git_branch)$NC\$ "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment