Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Orion/How Tos/Using Gerrit in Orion
Contents
Introduction
This How To makes a few assumptions:
- That you have already configured the Git repository you wish to use Gerit with, and that Gerrit has been enabled on the repository. If you have not cloned a repository yet, try viewing the How To page for working with Git
- That you are working with the Orion repositories, as all of the screen shots and examples will mention those repositories exclusively. If you are not trying to set up Gerrit for the Orion repositories, the steps will be generally the same but the URLs will differ.
- That you have a valid Eclipse.org log-in and will not be using anonymous access to Gerrit
Setting up the Gerrit remote
To use Gerrit you have to set up another remote for your repository that points to the Gerrit instance.
In this example we will be adding a remote for the [Orion client repository].
The first step is to find the project in Gerrit so we can determine what its URL is. To do this go to the
Gerrit projects page and filter using orion
, then select the client project.
On the Orion client project page there will be different URL information for how to set up your remote. At the top of the information page you will see a URL like ssh://<your_user_name>@git.eclipse.org:29418/orion/org.eclipse.orion.client
.
Now with the Gerrit URL at hand, there are two ways to configure Orion:
- you can use the UI from the repositories page
- you can use the Git command line
First we will discuss the UI way.
From the UI
Once you are logged into the Orion client, use the navigation menu to open the Git repositories view. Assuming have already cloned the Orion client repository, lets add the Gerrit remote.
- Select the Orion client repository, taking you to the information page with a section called Remotes
- Expand that section and click the New Remote button on the right hand side
- In the Name box supply a meaningful name, such as
gerrit
- In the URL box enter the URL fro the Gerrit project page, in this case it will be
ssh://git.eclipse.org:29418/orion/org.eclipse.orion.client
- Press Submit and you should see your new Gerrit remote
- In the Configuration section select the
Show all
link on the right hand side - Find the remote.gerrit.fetch setting and change it to be
refs/notes/*:refs/notes/*
- Using the New Configuration Entry button on the right hand side and the new entry
remote.gerrit.push
and set its value to beHEAD:refs/for/master
- Head back to the Remotes section and do a pull on the
gerrit
remote to make sure it is working.