Skip to content

Instantly share code, notes, and snippets.

@fellix
Created November 22, 2012 17:11
Show Gist options
  • Save fellix/4132182 to your computer and use it in GitHub Desktop.
Save fellix/4132182 to your computer and use it in GitHub Desktop.
my bash profile
source /usr/local/Cellar/git/1.7.11.3/etc/bash_completion.d/git-completion.bash
function git_branch_name(){
git branch 2>/dev/null | grep -e '^*' | sed -E 's/^\* (.+)$/(\1) /'
}
function show_colored_git_branch_in_prompt(){
#PS1="\[\033[01;32m\]\u@\h:\[\033[01;34m\]\w\[\033[31m\]\$(git_branch_name)\[\033[m\]$ "
#PS1='\[\033[32m\]\u \033[34m\][\w]\[\033[00m\]:\[\033[31m\]$(__git_ps1)\[\033[00m\]\$ '
PS1='\[\033[32m\]\u \033[01;34m\][\w]\[\033[31m\]$(__git_ps1)\[\033[00m\] \$ '
}
show_colored_git_branch_in_prompt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment