Skip to content

Instantly share code, notes, and snippets.

@jrgcubano
Forked from andywenk/git_bash_completion.sh
Created May 26, 2014 20:38
Show Gist options
  • Save jrgcubano/c5b5423e73e2bc3cc119 to your computer and use it in GitHub Desktop.
Save jrgcubano/c5b5423e73e2bc3cc119 to your computer and use it in GitHub Desktop.
git_version() {
git --version | sed -e 's/.*\([0-9].[0-9].[0-9]\)/\1/'
}
if [ -f "/usr/local/Cellar/git/$(git_version)/etc/bash_completion.d/git-completion.bash" ]; then
. "/usr/local/Cellar/git/$(git_version)/etc/bash_completion.d/git-completion.bash"
fi
if [ -f "/usr/local/Cellar/git/$(git_version)/etc/bash_completion.d/git-prompt.sh" ]; then
. "/usr/local/Cellar/git/$(git_version)/etc/bash_completion.d/git-prompt.sh"
fi
. /usr/local/Library/Contributions/brew_bash_completion.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment