Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git Warning: remote HEAD refers to nonexistent ref, unable to checkout

Tags:

git

gitosis

I'm trying to setup gitosis according to the instructions here.

It works fine from my remote machine so the server seems to be setup fine but I'd also like to be able to do development on my gitosis server machine from a different user account (not the git user created in the gitosis setup).

I've copied the key and modified the gitosis.conf so that the other user account has access but when I try to clone it seems to work except at the end it says:

git Warning: remote HEAD refers to nonexistent ref, unable to checkout 

and I end up with an empty directory except for .git

I've google for this a bit but have no real insight into what the problem is

like image 382
srboisvert Avatar asked Dec 25 '09 14:12

srboisvert


People also ask

How do I fix warning remote head refers to nonexistent ref unable to checkout?

Resolving deltas: 100% (46985/46985), done. > warning: remote HEAD refers to nonexistent ref, unable to checkout. To fix the error, you'll need to be an administrator of the repository on GitHub.com. You'll want to change the default branch of the repository.

Why my git clone is not working?

If you have a problem cloning a repository, or using it once it has been created, check the following: Ensure that the user has gone through initial GitCentric login and has the correct username, email, and ssh. This should return a usage message that refers to the config-branch, config-repo, and ls-repo commands.

Why repository is not found?

Fix 1 - Git - remote: Repository not found If you are new to programming and developing then you might have not set remote repo URL on your local repo. And trying to push the changes to remote. This is needed when you downloaded the project as a zip file.


1 Answers

I found out what was going wrong. The problem was that I wasn't paying attention to the warnings when I was pushing to my gitosis server so I didn't realize that I wasn't pushing a particular branch. I had assumed it would just push the current but that isn't the case until you set:

git config push.default current 
like image 128
srboisvert Avatar answered Oct 07 '22 18:10

srboisvert