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)

관련 정보