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 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
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?