# GitHub, GitLab, and Gitea

> Connect GitHub, GitLab, or Gitea, open a repository workspace, and start agent tasks from merge requests, pull requests, and pushes.

Section: Automations · Updated: 2026-11-26 · Canonical: https://nested.me/docs/git

Nested works with repositories on GitHub, GitLab (gitlab.com or self-managed), and Gitea, including Forgejo, Codeberg, and a server your team runs. You connect an account once. Agents then list, clone, and push as you, and automations can start from events on that server.

GitHub.com is built in. Connecting it uses the [GitHub connector](https://nested.me/docs/connectors). A platform admin adds other servers for every team in the console, under **Integrations → Git providers**. A team owner or admin can also add a server only that team sees.

## Before you start

- Open **Settings → Git accounts**. Each server listed there is one you can connect.
- If the list is empty, ask an administrator to add a server.

## Connect an account

1. On the server you need, select **Connect**, or **Use token** and paste a personal access token.
2. For GitLab, create the token under **Preferences → Access tokens** with the `api` scope, or with `read_api` and `write_repository`.
3. For Gitea, create it under **Settings → Applications** with repository read and write, and issue access when agents should comment on pull requests.
4. A server only your team can use shows a **Team** badge. **Disconnect** deletes the stored credential. Nested can no longer clone or push there for you.

GitHub.com shows **Connected through the GitHub connector**. **Connect** on that row opens the connector, not a separate token form.

## Open a repository

1. Select **New workspace**, then **One repository**.
2. Pick the **Git server**, search for the repository, and choose a branch.
3. Select **Create workspace**.

Clone and fetch go through a proxy on the agent. The git process does not hold your token, and the remote URL the agent can read does not contain it. See [Chat, workspaces, and tasks](https://nested.me/docs/chat).

## Start work from GitLab or Gitea

1. Select **New automation** and add a **GitLab** or **Gitea** trigger. Connect your account on that server first, or Nested refuses to save the webhook.
2. Choose the server, the **Level**, and the **Path**. On GitLab the level is a project or a group. On Gitea it is a repository or an organization.
3. Choose when it fires. Presets are **Merge or pull request opened**, **Review requested**, **Comment mentioning a user**, and **Push**. The event list also includes a change request updated, closed, or merged, **Comment created**, **Release published**, and **Issue opened**.
4. Optional: turn on **Acknowledge comments** to react to the comment that started the run, and **Reply on the merge or pull request** to post the result when the task ends.
5. Save. Nested registers the webhook with your connected account.

Without a bot token on the server, replies and reactions appear as you, the automation’s owner. GitHub automations use the Nested GitHub App instead. See [GitHub](https://nested.me/docs/github).

## Add a server for your team

A platform admin turns team servers on. Until then, **Settings → Team** says team git servers are not available.

When they are, team owners and admins add one as follows:

1. Open **Settings → Team**, find **Git servers**, and select **Add server**.
2. Choose **GitLab** or **Gitea or Forgejo**. Enter a **Name** and the **Base URL**. The address must be `https://`. Nested checks that the server answers as the kind you chose.
3. Optional: paste an OAuth **Client ID** and **Client secret**. The form shows the redirect URL to register on the git server, and the steps for GitLab or for Gitea and Forgejo. Without an OAuth application, members connect with **Use token**.
4. Optional: add a **Bot token** so automation replies are not tied to one member, and a **CA bundle (PEM)** when a private certificate authority signed the server.
5. Select **Save**, then **Test**. The test reports whether the server is reachable, and whether the OAuth client and bot token were accepted.

The address must be public. A name that resolves to a private or internal address is refused. Ask a platform admin to add that server for your team. A team can add 5 servers by default. The page shows how many you have. You cannot add a server that is already shared with every team. Connect that one under **Git accounts**.

**Delete** removes the server for everyone on the team, together with every member’s connected account on it, the webhooks Nested registered, and the MCP connectors made from it. Automations that used it stop and show that the server was removed. This cannot be undone.

## MCP connectors

- On GitLab, a team owner or admin selects **Create MCP connector** on the server in **Git accounts**. Members then connect it on the [Connectors](https://nested.me/docs/connectors) page. A GitLab administrator adds the `mcp` scope and the redirect URIs Nested shows.
- On Gitea, attach the `standard-gitea` pack and set `GITEA_HOST` and `GITEA_ACCESS_TOKEN`.

## Example

Your team runs GitLab at `https://gitlab.example.com`. An owner adds it under **Git servers**, with an OAuth application, and selects **Test**. You open **Git accounts**, select **Connect**, and create a **One repository** workspace on `acme/api`. An automation on **Merge or pull request opened** reviews that project and replies on the merge request.

## Questions

### Do I need the GitHub connector to use GitLab or Gitea?

No. Connect the GitLab or Gitea server under **Settings → Git accounts**. The GitHub connector is for GitHub.com.

### Why was my team’s git server refused?

The usual reasons: the address is not public, the team already has a server there, the server is already shared with every team, or the team is at its server limit (5 by default). A private address has to be added by a platform admin.

### Who can add or delete a team git server?

Team owners and admins, after a platform admin has turned team servers on. Members connect accounts and create workspaces. They do not add servers.

[Open in Nested](https://app.nested.me/settings/git)

## Related

- [GitHub](https://nested.me/docs/github)
- [Chat, workspaces, and tasks](https://nested.me/docs/chat)
- [Automations](https://nested.me/docs/automations)
- [Connectors](https://nested.me/docs/connectors)
