How can I configure zsh to autocomplete branch names while using 'git checkout'? How can I configure zsh to autocomplete branch names while using 'git checkout'? git git

How can I configure zsh to autocomplete branch names while using 'git checkout'?


The easiest way (and probably the only one not requiring a serious amount of hacking) is to update zsh. On my zsh 4.3.9 autocompletion works for git branches.


I got git autocomplete to work in zsh by adding this to my .zshrc:

autoload -Uz compinit && compinit

Credit: https://stackoverflow.com/a/67627099/480608