Git clone download code prompts that the file pointed to by head does not exist


git clone Downloading a repository gives a warning that no related code is being generated

warning: The remote HEAD points to a reference that does not exist and cannot be detected.

warning: remote HEAD refers to nonexistent ref, unable to checkout.



The .git directory .git/refs/heads does not have a file pointed to by HEAD

git branch -a
git checkout remotes/origin/Zoro

At this point, there is code in the project directory
git branch
(the header pointer is separated from origin/Zoro)

git checkout -b remotes/origin/Zoro

Switch to a new branch ‘remotes/origin/Zoro’

* remotes/origin/Zoro

create head

git branch -m remotes/origin/Zoro master

* master Switch to master branch

git branch -a
* master
attention:git help branch(command name) View help

Similar Posts: