Skip to content

Instantly share code, notes, and snippets.

@rkmax
Created April 11, 2011 03:45
Show Gist options
  • Save rkmax/913031 to your computer and use it in GitHub Desktop.
Save rkmax/913031 to your computer and use it in GitHub Desktop.
show Git branch with color and only name the folder
function git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1) /'
}
PS1='\[\033[0;37m\][\[\033[01;36m\]\W\[\033[0;37m\]] \[\033[0;32m\]$(git_branch)\[\033[00m\]\$ '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment