From The Document Foundation Wiki
Jump to: navigation, search

Setting yourself up for gerrit

Before you start: Troubleshooting help

The instructions below should be easy and quick to follow. However, if you get stuck somewhere, here is how you get help:

Register in Gerrit for first time

In order to create a new account in Gerrit, launch gerrit and click on the “Register” link at the top right of the page, pick your favorite OpenID (List of OpenID providers) or OAuth2 provider and use it to log in.

Currently two OAuth2 providers are supported (pending OAuth2 plugin activation):

  • GitHub
  • Google

Switch accounts in Gerrit (Link another identity)

Different OpenID or OAuth2 account can be used (linked) to the same Gerrit user accounts.

WARNING: Please do not login with new account, because in this case you will create new account in Gerrit and not link new OpenID|OAuth2 identity to the existing Gerrit account!

To link new OpenID or OAuth2 accoun to the existing Gerrit account:

  1. login with your existing account into Gerrit
  2. navigate to User => Settings => Identites or go directly to
  3. Push "Link another identity" button
  4. Select alternative identity
  5. Login
  6. Done

Setting yourself up for gerrit - the easy way

If you have a checkout of libreoffice/core already, you can just run ./logerrit setup, which will try to automatically setup keys and configure ssh for you, and if it can't it will guide you through these steps: if necessary, just follow the steps.

The program will tell you to go to, click Register and remember your username. The program will also generate a public SSH key, print it and save it to /home/[username]/.ssh/ This key will begin with 'ssh-rsa'. You must enter this key during the registration process on the website (or add it later in SSH Public Keys under Settings in order for gerrit to work.

If ./logerrit test fails and ssh -vvv logerrit informs you about ~/.ssh/config having bad permissions, run chmod 600 config in ~/.ssh.

The alternative is fiddling with the manual approach, details of which can be found at Development/gerrit/setup.

Detailed and nitty-gritty setup topics

Setting yourself up for gerrit - the manual way

  1. Create an account at (requires OpenID which you already have if you have a Yahoo, Blogger, Launchpad, flickr, WordPress, MySpace account)
  2. You must set your username in your gerrit account settings). Users are associated by username and SSH key. This username is referred to as YOUR_USERNAME_HERE below.
  3. Add the email address you use when working with git in the settings under "Contact Information"
  4. Generate an SSH keypair for gerrit and upload the public key in the preferences (of course you can also reuse an existing key)
  5. Add the following to your ${HOME}/.ssh/config (both sections are identical except for the "Host" line):
     Host logerrit
           IdentityFile /path/to/your/private-key
           User YOUR_USERNAME_HERE (cf. above)
           Port 29418

    Note that /path/to/your/private-key must include the file name as well. For example: ~/.ssh/id_rsa

  6. Setup your git repo so that it pushes to gerrit using the SSH key:
     git config remote.origin.pushurl ssh://logerrit/core
  7. and you are ready to go!

Now push !

See: How to submit patches