Skip to content

Instantly share code, notes, and snippets.

@duff
Created April 8, 2009 19:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save duff/91935 to your computer and use it in GitHub Desktop.
Save duff/91935 to your computer and use it in GitHub Desktop.
Some git auto complete goodness
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'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment