简体   繁体   中英

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM