问题
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.
回答1:
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.
回答2:
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
来源:https://stackoverflow.com/questions/18872651/unable-to-clone-all-projects-repo-after-gerrit-install