Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to clone All-Projects repo after Gerrit install

Tags:

git

gerrit

I have a newly setup instance of Gerrit

Currently there are only two repos: All-Projects binutils-test

When attempting to clone All-Projects I receive the following error:

git clone  ssh://user@hostname:29418/All-Projects
Initialized empty Git repository in /home/user/
error: Trying to write ref HEAD with nonexistant object 2055f748c7285720057fe7213258e6c5b11776e3
fatal: Cannot update the ref 'HEAD'.

Cloning of the other repository (binutils-test) works OK, so at least the basic setup seems OK. My user is a member of the Administators group, and so shouldn't have any access issues.

My end goal is cloning All-Projects so I can modify the project.config to add the Verified label.

like image 399
tom Avatar asked Sep 18 '13 12:09

tom


People also ask

Why can't I clone my repository?

If you see this error when cloning a repository, it means that the repository does not exist or you do not have permission to access it.

How do I clone a Gerrit repository?

Cloning a Gerrit project is done the same way as cloning any other git repository by using the git clone command. $ git clone ssh://gerrithost:29418/RecipeBook.git RecipeBook Cloning into RecipeBook... The URL for cloning the project can be found in the Gerrit web UI under Projects > List > <project-name> > General .

Do you have to clone a repo every time?

When you clone a repository, you don't get one file, like you may in other centralized version control systems. By cloning with Git, you get the entire repository - all files, all branches, and all commits. Cloning a repository is typically only done once, at the beginning of your interaction with a project.


2 Answers

This blog provides details on how to add the "Verified Label" in the project.config and that required you to modify the All-Projects projects.

like image 167
uncletall Avatar answered Nov 23 '22 23:11

uncletall


After posting a similar question to the gerrit mailing list (repo-discuss), I got the following instructions. These at least act as a workaround and enabled me to edit the project.config and push the changes back to gerrit. I now have a working "verified" label.

$ git init cfg ; cd cfg
$ git remote add origin ssh://user@hostname:29418/All-Projects
$ git pull origin refs/meta/config
$ vi project.config
$ git commit -a -m 'Updated permissions'
$ git push origin HEAD:refs/meta/config

this is described in http://www.eclipsecon.org/2013/sites/eclipsecon.org.2013/files/Deploying%20Gerrit%20Code%20Review.pdf

like image 21
tom Avatar answered Nov 23 '22 23:11

tom