Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Update git completion on macOS



> On Oct 23, 2020, at 4:16 AM, jost.schulte@xxxxxxxxxxxx wrote:
> 
> Here's my problem: Running on macOS 10.15, I've set up zsh with completion of
> git commands. It must be the complete function that comes with the os
> installation of zsh, because I didn't add it and I don't use oh-my-zsh. In
> this complete function the newer git commands like "switch" or "restore" are
> not included, so I want to update it.
> 
> I've researched a while and found the function in /usr/share/zsh/5.7.1/
> functions/ in the file _git. What I couldn't find is a current complete
> function and also I wasn't able to modify the contents of the file. Even using
> "sudo" I get the error that I don't have permissions to edit it.
> 
> Can anyone help me out please?

Assuming that installing 5.8 isn't an option, I think your best bet
is to extract _git from 5.8 (http://zsh.sourceforge.net/Arc/source.html)
and modify your fpath so the completion system finds it before the
system's outdated copy. It's fine to keep it somewhere in your home
directory.

(Hopefully the 5.8 _git works with 5.7.1, but if it doesn't you can
always edit it.)

vq



Messages sorted by: Reverse Date, Date, Thread, Author