Gitolite

Site admins can link and sync Git repositories on Gitolite with Sourcegraph so that users can search and navigate the repositories.

To set this up, add Gitolite as an external service to Sourcegraph:

  1. Go to User menu > Site admin.
  2. Open the External services page.
  3. Press + Add external service.
  4. Enter a Display name (using “Gitolite” is OK if you only have one Gitolite instance).
  5. In the Kind menu, select Gitolite.
  6. Configure the connection to Gitolite in the JSON editor. Use Cmd/Ctrl+Space for completion, and see configuration documentation below.
  7. Press Add external service.

Configuration

{
	// Regular expression to filter repositories from auto-discovery, so they will not get cloned automatically.
	"blacklist": null,

	// 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"}]

	// 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/"

	// Phabricator instance that integrates with this Gitolite instance
	"phabricator": null,

	// This is DEPRECATED. Use the `phabricator` field instead.
	"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/"
}