public
Last active

Some git auto complete goodness

  • Download Gist
bash_prompt_with_git_branch.bash
Shell
1 2 3 4 5 6 7 8 9
 
source ~/bin/.git-completion.sh # Copied from the contrib/completion/git-completion.bash file in the git distribution (Also here: http://gist.github.com/91932)
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo '*'
}
 
PS1='\[\e[0m\][ \[\e[32m\]\w \[\e[0m\]]$(__git_ps1 " \[\e[33m\]%s$(parse_git_dirty)") \[\e[0m\]$ \[\e[0m\]'
 
alias bash_profile='vi ~/.bash_profile && source ~/.bash_profile'

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.