Skip to content

Instantly share code, notes, and snippets.

@bradwright
Created September 14, 2012 15:16
Show Gist options
  • Save bradwright/3722557 to your computer and use it in GitHub Desktop.
Save bradwright/3722557 to your computer and use it in GitHub Desktop.
Git completion
# -*- mode: sh -*-
autoload -Uz compinit
compinit
source_if_exists() {
[ -f $1 ] && source $1
}
# These are installed by homebrew
source_if_exists /usr/local/etc/bash_completion.d/git-prompt.bash
source_if_exists /usr/local/etc/bash_completion.d/git-completion.bash
precmd() {
export PS1="%n@%m %~ $(__git_ps1 '%s') %# "
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment