- Download the git completions script.
$ curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash
- Add the script to your ~/.bash_profile.
if [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
fi
- Press
tab
after any git command and it will provide suggestions and branch names.