> ## Documentation index
> Fetch the complete documentation index at: https://upstash-context7-git-ctx7-4280-helm-registry-login-c44ca5.docs7.io/llms.txt
> Ask it with GET https://upstash-context7-git-ctx7-4280-helm-registry-login-c44ca5.docs7.io/ask?q=<keywords or question>. Short keywords rank best.
> Use these to discover all available pages before exploring further.
> Feature requests: https://upstash-context7-git-ctx7-4280-helm-registry-login-c44ca5.docs7.io/resources/feature-requests.md lists what users asked for and how to vote for a request or add one.
> Page rating: `GET https://upstash-context7-git-ctx7-4280-helm-registry-login-c44ca5.docs7.io/feedback?path=/enterprise/integrations/other-git&helpful={true|false}&comment={comment}` records whether this page helped. The `comment` (URL-encoded, at most 500 characters) says what helped, or what was missing or wrong; a `helpful=false` rating needs it. It is anonymous and needs no key. Comments hold no code, secrets or personal data.

# Other Git Integration

> Ingest private repositories from a self-managed Git host such as Gerrit, Gitea, or self-hosted Bitbucket over HTTPS or SSH

Context7 can clone and index repositories from any self-managed Git host that isn't GitHub or GitLab, such as **Gerrit**, **Gitea**, or **self-hosted Bitbucket**, over **HTTPS** or **SSH**.

Under **Workspace Settings › Other Git**, choose **HTTPS** or **SSH**, and then [add repositories](#add-a-repository) with their normal clone URL. The **Host** field is on the **HTTPS** tab. It decides which `https://` repositories use the stored credentials, and which repositories use the review publishing settings.

You can configure one Other Git host:

- HTTPS credentials apply only to `https://` URLs on that host.
- The SSH key is used for every `ssh://` clone.

If you use Gerrit, see the [Gerrit integration guide](/enterprise/integrations/gerrit) to submit generated code documentation through `refs/for/{branch}`.

<Note>
These hosts have no GitHub-style webhooks. Drive re-indexing on merge from your CI, for example Jenkins, by calling `POST /api/projects/<id>/refresh` after a push. Use `POST /api/gitops/reconcile` when your [GitOps](/enterprise/gitops) manifest changes.
</Note>

## HTTPS (basic auth)

Enter the host, select **HTTPS**, and fill in the account credentials:

<Frame>
  <img src="/images/enterprise/integrations/other-git-https.png" alt="Other Git HTTPS settings: host, username, and HTTP password under Workspace Settings, Other Git" />
</Frame>

| Field | Description |
| ----- | ----------- |
| Host | The Git host, without `https://`. For example, `gerrit.your-company.com`. Repositories whose `https://` URL is on this host are cloned with the credentials below. |
| Username | The account username. This is required, because HTTP basic auth needs a username (for Gerrit, generate an HTTP password in its settings and use that account's username). |
| HTTP password or token | The account's HTTP password or access token. |

Then add a repository with its HTTPS clone URL, for example `https://gerrit.your-company.com/a/platform/sdk`.

<Note>
Does your host use a private or self-signed TLS certificate? Set `NODE_EXTRA_CA_CERTS` to your CA bundle (recommended). Context7 then trusts it for all outbound HTTPS, including git.

`GIT_TLS_INSECURE=true` turns off TLS checks for all outbound HTTPS, not only git. Use it for testing only.

Use `https://` for clones with credentials. Context7 refuses to send credentials over plain `http://` to a host that is not on loopback.
</Note>

## SSH (deploy key)

When a repository is added with an `ssh://` URL, for example `ssh://<user>@gerrit.your-company.com:29418/platform/sdk`, Context7 authenticates with a deploy key. Select **SSH**, and register the key's **public** half on a service account in your Git host that can read the repositories you want to index. Then give Context7 the private half one of two ways. The key is used for every `ssh://` clone, whatever the host. If you use [review publishing](/enterprise/integrations/gerrit) over SSH, also enter the host on the **HTTPS** tab.

### Paste the key in the UI (recommended)

On the **SSH** tab, paste the private key. It is stored encrypted and used for all `ssh://` clones. Optionally paste a `known_hosts` entry to pin the host key; if you leave it blank, the host key is trusted on first use.

<Frame>
  <img src="/images/enterprise/integrations/other-git-ssh.png" alt="Other Git SSH settings: private key and known hosts under Workspace Settings, Other Git" />
</Frame>

Generate the `known_hosts` entry with `ssh-keyscan`, for example:

```bash
ssh-keyscan -p 29418 gerrit.your-company.com
```

That's all you need. Add repositories with their `ssh://` URL and they clone with the pasted key.

### Mount a key into the container (alternative)

If you prefer the private key never touch the application (it is never written to the database or included in backups), mount it into the container instead and point Git at it with `GIT_SSH_COMMAND`. Leave the UI SSH key blank, and a mounted key is used whenever no key is configured in the UI.

<Tabs>
  <Tab title="Kubernetes">
    ```yaml
    apiVersion: v1
    kind: Secret
    metadata:
      name: context7-git-ssh
    type: Opaque
    stringData:
      id_ed25519: |
        -----BEGIN OPENSSH PRIVATE KEY-----
        ...
        -----END OPENSSH PRIVATE KEY-----
      known_hosts: |
        [gerrit.your-company.com]:29418 ssh-ed25519 AAAA...
    ```

    ```yaml
    spec:
      containers:
        - name: context7
          env:
            - name: GIT_SSH_COMMAND
              value: "ssh -i /etc/git-ssh/id_ed25519 -o UserKnownHostsFile=/etc/git-ssh/known_hosts"
          volumeMounts:
            - name: git-ssh
              mountPath: /etc/git-ssh
              readOnly: true
      volumes:
        - name: git-ssh
          secret:
            secretName: context7-git-ssh
            defaultMode: 0400
    ```
  </Tab>
  <Tab title="Docker">
    ```bash
    docker run -d -p 3000:3000 -v context7-data:/data \
      -v /path/to/id_ed25519:/etc/git-ssh/id_ed25519:ro \
      -v /path/to/known_hosts:/etc/git-ssh/known_hosts:ro \
      -e GIT_SSH_COMMAND="ssh -i /etc/git-ssh/id_ed25519 -o UserKnownHostsFile=/etc/git-ssh/known_hosts" \
      -e LICENSE_KEY="$LICENSE_KEY" \
      ghcr.io/context7/enterprise
    ```
  </Tab>
</Tabs>

<Note>
The on-premise image ships with an SSH client, so no extra packages are needed either way.
</Note>

## Add a repository

Once the host is configured, add repositories the same as any other source:

<Steps>
  <Step title="Open Add source">
    Click **Add source** and choose the **Other Git** source.
  </Step>
  <Step title="Paste the clone URL">
    Enter the repository's clone URL. The scheme selects how it authenticates:

    - **HTTPS**: `https://gerrit.your-company.com/a/platform/sdk` (uses the HTTPS credentials above).
    - **SSH**: `ssh://<user>@gerrit.your-company.com:29418/platform/sdk` (uses the deploy key).
  </Step>
  <Step title="Parse">
    Context7 clones, indexes the documentation, and serves it over MCP. Re-index later with the project's **Refresh** action or from CI. See [GitOps](/enterprise/gitops).
  </Step>
</Steps>

You can also declare these repositories in a [GitOps](/enterprise/gitops) manifest to manage the whole index as code.
