Gitolite
Site admins can link and sync Git repositories on Gitolite with Sourcegraph so that users can search and navigate the repositories.
To connect Gitolite to Sourcegraph:
- Set up git SSH authentication for your gitolite server.
- Go to Site admin > Manage code hosts > Add repositories
- Select Gitolite.
- Configure the connection to Gitolite using the action buttons above the text field, and additional fields can be added using Cmd/Ctrl+Space for auto-completion. See the configuration documentation below.
- Press Add repositories.
Configuration
admin/external_service/gitolite.schema.json
{ // A list of repositories to never mirror from this Gitolite instance. Supports excluding by exact name ({"name": "foo"}). "exclude": null, // Other example values: // - [ // { // "name": "myrepo" // }, // { // "pattern": ".*secret.*" // } // ] // Gitolite host that stores the repositories (e.g., [email protected], ssh://[email protected]:2222/). "host": null, // Other example values: // - "[email protected]" // - "ssh://[email protected]:2222/" // This is DEPRECATED "phabricator": null, // This is DEPRECATED "phabricatorMetadataCommand": null, // Repository name prefix that will map to this Gitolite host. This should likely end with a trailing slash. E.g., "gitolite.example.com/". // // It is important that the Sourcegraph repository name generated with this prefix be unique to this code host. If different code hosts generate repository names that collide, Sourcegraph's behavior is undefined. "prefix": null // Other example values: // - "gitolite.example.com/" }