When I say 'git checkout ' I want zsh to autocomplete names of my git branches. Is that possible?
This feature is a must-have if you work with long branch names. For example, if you typed git checkout ma and then pressed the Tab key, git tab autocomplete would automatically fill in the rest of the branch name, like this: git checkout main .
Configuring the Shell fpath : The git-completion. zsh is a function file, not designed to be sourced like the bash script. This command appends the ~/. zsh directory onto the shell's function lookup list.
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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With