Site admins can sync Git repositories hosted on their private Gerrit instance with Sourcegraph so that users can search and navigate the repositories.
To connect Gerrit to Sourcegraph:
- Go to Site admin > Manage code hosts > Add code host
- Select Gerrit
- Set url to the URL of your Gerrit instance.
- Provide an admin username and password. A password can be generated by following these instructions. Only HTTP/HTTPS credentials are supported.
- Click Add repositories.
{
"url": "https://gerrit.example.com",
"username": "<admin username>",
"password": "<admin password>",
"projects": [ // If not set, all projects on the Gerrit instance will be mirrored
"docs",
"kubernetes/kubernetes"
]
}By default, all Sourcegraph users can view all repositories. To configure Sourcegraph to use Gerrit's access management, see "Repository permissions".
If repository permissions is configured, Gerrit has to be added as an authentication provider. See the authentication documentation.
Gerrit connections support the following configuration options, which are specified in the JSON editor in the site admin "Manage code hosts" area.
[View page on docs.sourcegraph.com](https://docs.sourcegraph.com/admin/external_service/gerrit) to see rendered content.