Shashank Pandit
Shashank Pandit

Reputation: 151

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

When I say 'git checkout ' I want zsh to autocomplete names of my git branches. Is that possible?

Upvotes: 15

Views: 5590

Answers (2)

Raine Revere
Raine Revere

Reputation: 33675

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

Upvotes: 16

Jawa
Jawa

Reputation: 2332

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.

Upvotes: 2

Related Questions