Gerrit » History » Revision 8

« Previous | Revision 8/130 (diff) | Next »
neels, 05/12/2016 11:46 AM

Contributing using Gerrit

Gerrit is a review tool that integrates nicely with git and ssh. Instead of manually uploading a change, one can push it for review. One can use ssh to trigger review and actions.

Subprojects using Gerrit

The following projects use Gerrit to contribute changes:

  • libosmocore.git
  • libosmo-abis.git
  • libosmo-netif.git
  • libosmo-sccp.git
  • libsmpp34.git
  • openbsc.git
  • osmo-bts.git
  • osmo-iuh.git
  • osmo-pcu.git
  • cellmgr-ng.git
  • osmo-sip-connector.git

Configuring Gerrit/Account

You will need to sign-up at If you have an Osmocom Redmine account you can use as OpenID provider. After the initial sign-up you will need to:

  • Pick a username (can not be changed)
  • Add your public ssh key(s)
  • Add email addresses you intend to use as author/comitter

Setting up Gerrit for commits and pushing

  • Add the remote to be able to fetch and push to gerrit
  • Fetch the commit hook that adds Change-Id to each commit to uniquely identify a commit
PROJECT=$(basename $PWD)
git remote add gerrit ssh://$$PROJECT.git
scp -P 29418 $ .git/hooks/
  • In case your local username matches the gerrit username, the setup shortens to
PROJECT=$(basename $PWD)
git remote add gerrit ssh://$PROJECT.git
scp -P 29418 .git/hooks/


  • Push for review
    git push gerrit HEAD:refs/for/master
  • Push a user branch
    git push gerrit HEAD:refs/users/$USERNAME/topic
  • Directly push to master if you are allowed to
    git push gerrit HEAD:refs/heads/master
  • List changesets in gerrit
    git ls-remote gerrit changes/*

Updated by neels about 8 years ago · 8 revisions

Add picture from clipboard (Maximum size: 48.8 MB)