> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sourcebot.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Other Git hosts

Sourcebot can sync code from any Git host (by clone url). This is helpful when you want to search code that not in a [supported code host](https://docs.sourcebot.dev/docs/connections/indexing-your-code#platform-connection-guides).

If you're not familiar with Sourcebot [connections](https://docs.sourcebot.dev/docs/connections/indexing-your-code), please read that overview first.

## Getting Started

To connect to a Git host, create a new [connection](https://docs.sourcebot.dev/docs/connections/indexing-your-code) with type `git` and specify the clone url in the `url` property. For example:

```json theme={null}
{
    "type": "git",
    "url": "https://github.com/sourcebot-dev/sourcebot"
}
```

Note that only `http` & `https` URLs are supported at this time.

## Schema reference

> [accordion] Reference
>
> [schemas/v3/genericGitHost.json](https://github.com/sourcebot-dev/sourcebot/blob/main/schemas/v3/genericGitHost.json)
>
> ```json theme={null}
> {
>   "$schema": "http://json-schema.org/draft-07/schema#",
>   "type": "object",
>   "title": "GenericGitHostConnectionConfig",
>   "properties": {
>     "type": {
>       "const": "git",
>       "description": "Generic Git host configuration"
>     },
>     "url": {
>       "type": "string",
>       "format": "url",
>       "description": "The URL to the git repository. This can either be a remote URL (prefixed with `http://` or `https://`) or a absolute path to a directory on the local machine (prefixed with `file://`). If a local directory is specified, it must point to the root of a git repository. Local directories are treated as read-only modified. Local directories support glob patterns.",
>       "pattern": "^(https?:\\/\\/[^\\s/$.?#].[^\\s]*|file:\\/\\/\\/[^\\s]+)$",
>       "examples": [
>         "https://github.com/sourcebot-dev/sourcebot",
>         "file:///path/to/repo",
>         "file:///repos/*"
>       ]
>     },
>     "revisions": {
>       "type": "object",
>       "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.",
>       "properties": {
>         "branches": {
>           "type": "array",
>           "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.",
>           "items": {
>             "type": "string"
>           },
>           "examples": [
>             [
>               "main",
>               "release/*"
>             ],
>             [
>               "**"
>             ]
>           ],
>           "default": []
>         },
>         "tags": {
>           "type": "array",
>           "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.",
>           "items": {
>             "type": "string"
>           },
>           "examples": [
>             [
>               "latest",
>               "v2.*.*"
>             ],
>             [
>               "**"
>             ]
>           ],
>           "default": []
>         },
>         "overrides": {
>           "type": "array",
>           "description": "Per-repository overrides of `branches` and `tags`. For a given repo, the first override whose `repos` matches the repo is applied, and any later overrides are ignored. Repos that do not match any override use the connection-level `branches` and `tags`.",
>           "items": {
>             "type": "object",
>             "properties": {
>               "repos": {
>                 "type": "array",
>                 "description": "List of repositories this override applies to. Patterns are matched case-insensitively against the repo's display name (e.g., `org/repo`) and its full name (e.g., `github.com/org/repo`). Glob patterns are supported.",
>                 "items": {
>                   "type": "string"
>                 },
>                 "minItems": 1,
>                 "examples": [
>                   [
>                     "org/repo"
>                   ],
>                   [
>                     "org/legacy-*"
>                   ]
>                 ]
>               },
>               "mode": {
>                 "type": "string",
>                 "enum": [
>                   "append",
>                   "replace"
>                 ],
>                 "default": "append",
>                 "description": "How this override's `branches` and `tags` are combined with the connection-level `branches` and `tags`. `append` indexes both the connection-level patterns and this override's patterns. `replace` indexes only this override's patterns; if `branches` or `tags` is omitted from the override, the connection-level value is used for that field."
>               },
>               "branches": {
>                 "type": "array",
>                 "description": "List of branches to include when indexing the matching repos. Glob patterns are supported.",
>                 "items": {
>                   "type": "string"
>                 },
>                 "examples": [
>                   [
>                     "datastore-release/*"
>                   ]
>                 ]
>               },
>               "tags": {
>                 "type": "array",
>                 "description": "List of tags to include when indexing the matching repos. Glob patterns are supported.",
>                 "items": {
>                   "type": "string"
>                 },
>                 "examples": [
>                   [
>                     "v*"
>                   ]
>                 ]
>               }
>             },
>             "required": [
>               "repos"
>             ],
>             "additionalProperties": false
>           },
>           "examples": [
>             [
>               {
>                 "repos": [
>                   "org/datastore"
>                 ],
>                 "branches": [
>                   "datastore-release/*"
>                 ]
>               },
>               {
>                 "repos": [
>                   "org/legacy-*"
>                 ],
>                 "mode": "replace",
>                 "branches": [],
>                 "tags": []
>               }
>             ]
>           ]
>         }
>       },
>       "additionalProperties": false
>     },
>     "enforcePermissions": {
>       "type": "boolean",
>       "description": "Controls whether repository permissions are enforced for this connection. When `PERMISSION_SYNC_ENABLED` is false, this setting has no effect. Defaults to the value of `PERMISSION_SYNC_ENABLED`. See https://docs.sourcebot.dev/docs/features/permission-syncing"
>     },
>     "enforcePermissionsForPublicRepos": {
>       "type": "boolean",
>       "default": false,
>       "description": "Controls whether repository permissions are enforced for public repositories in this connection. When true, public repositories are only visible to users with a linked account for this connection's code host. When false, public repositories are visible to all users. Has no effect when enforcePermissions is false. Defaults to false. See https://docs.sourcebot.dev/docs/features/permission-syncing"
>     }
>   },
>   "required": [
>     "type",
>     "url"
>   ],
>   "additionalProperties": false
> }
> ```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.