How to upload a git repo to gerrit?

gemfield picture gemfield · Dec 2, 2011 · Viewed 9.3k times · Source

I installed the gerrit service on a ubuntu server,and my PC as client. I created a git repo on my PC(with msysgit),and the question is :how can I upload the git repo to the Ubuntu server?Should I do some work on Ubuntu server first(i just installed gerrit and git service )?

Answer

Greg Hewgill picture Greg Hewgill · Dec 2, 2011

First, you need to create the project on the Gerrit server using gerrit create-project.

Next, edit the project permissions if necessary to add the following for your user (Administrators group, probably):

  • Create reference
  • Forge committer identity
  • Forge author identity

This allows you to upload an existing history, perhaps committed by different people, bypassing the need to review every commit you select.

Finally, push your code:

git remote add gerrit gerritserver:project
git push gerrit master:refs/heads/master