The following warning occurs during git clone:
warning: remote HEAD refers to nonexistent ref, unable to checkout
The reason is that the/. Git/refs/Heads file in the. Git directory does not contain the file pointed to by the head under the. Git directory. You can use the GIT show-ref command to view other files.
eadc2c7d702724e788d8c6bcdb638b6b228e6ab5 refs/heads/another_branch
You can use git branch-M anoter_branch master in this directory to change another_branch to master, so that this warning will not occur during re-cloning.
You can also view all Sha values in the refs directory through git rev-Parse -- all.
You can use git rev-Parse to check the Sha value of a certain branch tag. Is there a way to know the Sha value and its corresponding branch and tag? It seems impossible?
Note: The cause of this problem is that a local git project is copied and then cloned based on this project, because there is only my_topic locally, only one my_topic branch is cloned, and the remote branch of the server will not be cloned here.
When using the local bionic clone
Git clone bionic local_bionic
Then
Git remote show origin
* Remote origin
Fetch URL:/home/hebo/work/test/bionic
Push URL:/home/hebo/work/test/bionic
Head Branch (Remote head is ambiguous, may be one of the following ):
Froyo-prod-bb
My_topic
Remote branches:
Froyo-prod-BB tracked
My_topic tracked
Local branch configured for 'git pull ':
Froyo-prod-BB merges with remote froyo-prod-bb
Local ref configured for 'git push ':
Froyo-prod-BB pushes to Froyo-prod-BB (up to date)
In this case, the remote branch is the cloned object, while the remote branch of bionic itself cannot be retained, and the cloned warehouse, the current branch, what is the branch of clone in local checkout.