La command zsh git auto-complete ajoute une origine supplémentaire au nom de la twig git

Après avoir cloné un repository git localement, je veux changer de twig, dit "ABCD".

$ git branch -a * master remotes/origin/ABCD remotes/origin/HEAD -> origin/master remotes/origin/master $ git checkout origin/ABCD #### <- Here is the problem! Note: checking out 'origin/ABCD'. You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any twigs by performing another checkout. If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example: git checkout -b new_branch_name HEAD is now at f2bf54a... Clean up README.md 

Quand j'appuie sur tab après git checkout , pour une raison quelconque, l'autocomplétion commence toujours par l' origin/ et donc un message d'avertissement de l'état HEAD détaché .

Comment puis-je faire l'auto-complétion pour ne pas append «origine» au début?

J'ai trouvé un excellent plugin pour zsh que vous pouvez utiliser. Si vous utilisez oh-my-zsh alors il s'appelle gitfast ou si vous utilisez zsh vous pouvez suivre les instructions de son article de blog.

Comme l'auteur le précise, il y a en fait beaucoup de problèmes de complétion et ses efforts sont de les résoudre tous. C'est un problème qui fonctionne maintenant comme dans bash.

https://felipec.wordpress.com/2013/07/31/how-i-fixed-git-zsh-completion/

Pour activer dans oh-my-zsh éditez votre .zshrc et changez la ligne des plugins pour append gitfast comme ceci

 plugins=(git gitfast)