Quantcast
Channel: zsh git command auto-complete add extra origin to the git branch name - Unix & Linux Stack Exchange
Viewing all articles
Browse latest Browse all 2

zsh git command auto-complete add extra origin to the git branch name

$
0
0

After I clone a git repository locally, I want to switch branch to, says, '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 experimentalchanges and commit them, and you can discard any commits you make in thisstate without impacting any branches by performing another checkout.If you want to create a new branch to retain commits you create, you maydo so (now or later) by using -b with the checkout command again. Example:  git checkout -b new_branch_nameHEAD is now at f2bf54a... Clean up README.md

When I press tab after git checkout, for some reason the autocompletion always starts with origin/ and hence a warning message of detached HEAD state.

How can I make the autocomplete not to add 'origin' at the beginning?


Viewing all articles
Browse latest Browse all 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>