zsh git コマンドのオートコンプリートは、git ブランチ名に追加のソースを追加します。

zsh git コマンドのオートコンプリートは、git ブランチ名に追加のソースを追加します。

gitリポジトリをローカルに複製した後、ブランチを「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 branches 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

後でTabを押すと、git checkout何らかの理由でオートコンプリートが常にで始まり、origin/警告メッセージが表示されます。別個のヘッド状態。

オートコンプリートはどのようにできますか?いいえ最初に「ソース」を追加しますか?

ベストアンサー1

zsh使用できる素晴らしいプラグインが見つかりました。 thenを使用している場合はoh-my-zsh呼び出されgitfast、単に使用している場合はzsh彼のブログの記事にある指示に従うことができます。

著者が詳しく説明したように、実際には完成の問題がかなり多くあり、gitすべて彼が働いています。今問題はbashで動作する方法と同様に動作します。

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

以下のようにoh-my-zsh編集を有効にしてプラグインラインを変更してgitfastを追加するには.zshrc

plugins=(git gitfast)

おすすめ記事