Activities

January 2016
M T W T F S S
« Nov   Feb »
 123
45678910
11121314151617
18192021222324
25262728293031

Git Error : remote HEAD refers to nonexistent ref, unable to checkout.

We are using GitLab application to manage the version for all the project. One of the dev team has got an error while he is trying to clone the existing git repo for the first time.

@erw-165:~/public_html$ git clone git@github.mycompany.com:COMadmin/myproject.git
Cloning into 'myproject'...
remote: Counting objects: 5552, done.
remote: Compressing objects: 100% (4453/4453), done.
remote: Total 5552 (delta 1189), reused 5218 (delta 979)
Receiving objects: 100% (5552/5552), 77.31 MiB | 179.00 KiB/s, done.
Resolving deltas: 100% (1189/1189), done.
Checking connectivity... done.
warning: remote HEAD refers to nonexistent ref, unable to checkout.

I’m also seeing this kind of error for the first time. I had restarted the gitlab service as a false thought of if there is something with GitLab rails application. But that does not helped me much. So I decided to explore it more.

When I was checking the project reposity over GitLab UI and found that there is no master branch has been created there under “FILES” area. This was the culprit of error.

Solution

Create a new branch named master in Git and try to do the checkout again. It will work flawlessly.

Have a great day ::).

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>