Adding a GitHub project to GerritHub
If you have a GitHub project and want people to be able to contribute to your project by adding code and reviewing patches you can add it to GerritHub.
Gerrit is a free, web-based team code collaboration tool. Software developers in a team can review each other’s modifications on their source code using a Web browser and approve or reject those changes. It integrates closely with Git, a distributed version control system. (From Wikipedia).
Adding your Project to GerritHub
- Go to GerritHub
- If you haven’t registered yet - Click on ‘First Time Sign In’ button on the upper right corner.
- Click on the ‘Sign In’ Button on the upper right corner.
- Enter your GitHub credentials (Unless you are already logged in to GitHub) You’ll see the Dashboard:
- Click on the bold GitHub at the top of the dashboard and then on ‘Repositories’.
- Mark the repository you want to import and click ‘Import’ -> Next -> Next
Adding a SSH key
Before you can push your changes to Gerrit you need to add your SSH key:
- Click on your username (upper right corner) -> Settings
- On the next page choose SSH Public Keys . Then add your ssh public key.
Submitting a change to your project
- Go back to your Dashboard and click on Projects and search your project i.e. username/project-name
- Click the Project and you’ll see details about the project.
- Install git and git-review For Fedora run:
$ sudo dnf -y install git git-review
- Copy the line starts with ‘git clone’ and run.
$ git clone ssh://@review.gerrithub.io:29418//
- Change directory to your project
$ cd
- Add Gerrithub as a remote named gerrit
$ git remote add gerrit \ ssh://@review.gerrithub.io:29418//
- Set the gerrit remote
$ git remote -s
- Make your changes and commit 9. Show the latest commit and make sure you see a line with Change-Id
$ git log -1 commit 91666e02ac48f0922b48c180bf6a7eca082a940e Author: user <user@example.com> Date: Thu Oct 13 00:00:08 2016 +0000 test Change-Id: I104eccd92cfda7da4744f0877f10ff15ff1ae16a
- Submit your change to GerritHub
$ git review
- Go to the GerriHub Dashboard and click on My->Changes. You should see your patch Under the ‘Outgoing reviews’
Reviewing a Patch
For testing purpose you can approve the patch and see it merged in GitHub
- Click on the patch
- Click on ‘Reply..’
- If you want to approve the patch you can choose ‘+2’ and in the Code-review line and ‘+1’ at the Verified line.
You should now see a submit Button
- Click on the Submit button
- Go to your Github project and you should see your latest commit.
Adding reviewers
I found a great explanation here:https://github.com/midonet/midonet/wiki/Gerrit-Access-Rights-Policies
Leave a Comment