Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upSuggestion: add docs for zsh completions #1956
Open
Labels
Comments
|
Thank you for reporting! Due to the nature of hub extending git, our completions (both zsh and bash) might be a bit of a mess at the moment, and your research helps greatly. |
|
I created a PR to improve the docs: #1962 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


Out of the box, Zsh completions don't work as you would expect.
Given a fresh install:
When I type
git pull-<tab>, it successfully completes togit pull-request.However, completion does not work for subcommand arguments. For example, when I type
git pull-request -<tab>, the arguments do not complete.After some digging, I discovered that I had two sets of Zsh completions for Git (using the setup above, which I believe is the route most people will take):
/usr/local/share/zsh/site-functions/_git)/usr/local/Cellar/zsh/5.6.2_1/share/zsh/functions/_git)Both of these were on my
$fpath.I then discovered that the author of the Hub Zsh completions seems to advise the usage of Zsh's official Git completions, rather than Git's official completions: #295 (comment)
I removed Git's official completions with
rm /usr/local/share/zsh/site-functions/_gitand then Hub Zsh completions seemed to work as expected. That is, when I typegit pull-request -<tab>, arguments do complete.I would like to suggest that we clearly document this caveat—Hub Zsh completions only seem to fully work when using Zsh's official Git completions, rather than Git's official completions—along with instructions for how to use Zsh's official Git completions instead.
/cc @goodell