Skip to content

Instantly share code, notes, and snippets.

@swalberg
Last active August 29, 2015 14:10
Show Gist options
  • Save swalberg/c0c075e90aa4eb63543f to your computer and use it in GitHub Desktop.
Save swalberg/c0c075e90aa4eb63543f to your computer and use it in GitHub Desktop.
# This gets you the __git_ps1 function
if [ -f `brew --prefix`/etc/bash_completion.d/git-completion.bash ]; then
. `brew --prefix`/etc/bash_completion.d/git-completion.bash
fi
# show some extra metadata in the prompt such as if you have unchecked/tracked files
export GIT_PS1_SHOWDIRTYSTATE=1
export GIT_PS1_SHOWSTASHSTATE=1
export GIT_PS1_SHOWUNTRACKEDFILES=1
# Set the prompt
PS1='\h:\W$(__git_ps1 "(%s)") \$ '
# tab completion of branches and other refs
if [ -f `brew --prefix`/etc/bash_completion.d/git-prompt.sh ]; then
. `brew --prefix`/etc/bash_completion.d/git-prompt.sh
fi
# Try and fix bad behaviours
function gut {
growlnotify -m "It's git, dumbass"
git $*
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment