xxxxxxxxxx
# 1) Download official git autocompletion script:
curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash
# 2) Update execution permissions:
chmod u+x ~/.git-completion.bash
# 3) Update ~/.bash_profile with 'if file exists execute':
if [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
fi