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

# From a code repository

> Connect a git repository to run its code as a service. Archie builds and deploys the service on every push to your repository.

**From a Code Repository** connects a git repository you already own. It deploys on every push.

## Connect a repository

Go to **Backend → Logic**, click **New service**, select **From a Code Repository**, and click **Continue**. In the empty state, you can click **Import from Git** instead. The dialog is titled **From a Code Repository**.

![The From a Code Repository dialog with Name, Repository URL, Provider, Default branch, API token, and Webhook secret fields.](https://mintcdn.com/archie-e998dbf6/FcInvfd50seksJIy/images/22-logic-from-repository.png?fit=max\&auto=format\&n=FcInvfd50seksJIy\&q=85\&s=5aba2a185fbf1c276c810c57f0e9673b)

| Field | What to enter |
| - | - |
| **Name** (optional) | A name for the service. It defaults to the repository name. |
| **Repository URL** | The URL of the repository, for example `https://github.com/org/repo.git`. |
| **Provider** | **GitHub**, **GitLab**, or **Other Git**. **GitHub** is selected by default. |
| **Default branch** | The branch to deploy. It defaults to `main`. |
| **API token** | A personal access token for the repository. Archie stores it encrypted and never shows it again. |
| **Webhook secret** | A signing secret that Archie uses to verify incoming repository webhooks. Archie stores it encrypted. |

Click **Create function** to connect the repository. The button stays disabled until the required fields are filled in.

> [!WARNING]
>
> Treat the API token and webhook secret as credentials. Use a token that only has access to this repository.

## After you create the service

Open the service to follow its [deployments](https://archie.com/docs/backend/logic/deployments.md). Each push to the connected branch builds a new deploy. You can also read and edit the code in the [Code tab](https://archie.com/docs/backend/logic/working-with-a-service.md) and set [environment variables](https://archie.com/docs/backend/logic/environment-variables.md).

## FAQ

> **Which git hosts can I use?**
>
> **GitHub** and **GitLab** have their own options. Choose **Other Git** for any other git host.

> **When does the service deploy?**
>
> On every push, as described in the dialog: "Connect your own git repository. It deploys on every push."


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