Carmine Carmine - 15 days ago 5
Git Question

How to enable branch hints in Mac OS git?

In windows, when I use git bash, and for example want to to checkout to some branch, hitting tab shows me all the branches, or fills the branch name if I have written part of it. In my Mac OS, when I use git from my terminal, these features are disabled. Is there a way to enable them, and how?


You have to install git-autocomplete which can be get with homebrew:

  1. Install Git and bash-completion: brew install git bash-completion (Note: If this install fails with a 404 error, and you already have git installed, just remove the git part of this brew install)

  2. Add bash-completion to your .bash_profile:

if [ -f `brew --prefix`/etc/bash_completion ]; then
    . `brew --prefix`/etc/bash_completion