# Add repositories

> Connect GitHub with a token, choose repositories with a rule and wait until they are searchable.

Source: https://docs.corfedo.ai/get-started/add-repositories/

You connect the code host where your repositories live, choose which repositories Corfedo adds and index them. This page uses a GitHub fine-grained token, the quickest way to start. [Sources](https://docs.corfedo.ai/workspace/sources/) covers GitLab, Gitea, Forgejo, Bitbucket Cloud, Azure DevOps and GitHub Apps.

## Before you begin

- You are signed in to your workspace as its administrator, from [Set up your workspace](https://docs.corfedo.ai/get-started/workspace/).
- A GitHub account that can read the repositories you want to search.
- One or two repositories to start with, such as `acme/billing`. A small repository becomes searchable sooner.

## Connect GitHub

### Start a GitHub token connection

In your workspace, open **Settings** › **Sources** and select **Add connection**. Choose **GitHub token**.

### Create a fine-grained token

Select **New fine-grained token**. GitHub opens with read-only access filled in. Set **Resource owner** to the organization or account that owns your repositories, choose the repositories and an expiry longer than 14 days, generate the token and copy it.

An organization may require an owner to approve the token before it works.

### Test and save

Back in Corfedo, paste the token and select **Test and save**.

**Check:** the new connection shows **Healthy** next to its name. A token that expires within 14 days shows **Needs attention** instead. If the form shows **The connection was not saved**, fix the token on GitHub as the reason says and save again.

## Choose and index repositories

### Add a rule

On your connection, select the **Rules** tab and **Add rule**. Enter a **Name**. Under **Selects**, choose **A list of repositories** and enter one repository per line, such as `acme/billing`. Select **Index new repositories automatically**, then **Add rule**.

### Run the rule

Saving a rule does not run it. Select **Run now**. Each repository shows **Added**, or a reason such as **Not found** or **No access**.

## Check the result

**Check:** in **Repositories** in the sidebar, each repository shows **Not searchable** with a spinning icon while its first index is prepared, and then **Searchable**.

If a repository shows something else, [Repositories](https://docs.corfedo.ai/workspace/sources/repositories/#read-the-status) explains each status and what to do.

## Next step

[Try Corfedo in the browser](https://docs.corfedo.ai/get-started/try-it-in-the-browser/) on the repositories you indexed.
