> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.hodi.host/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# How do I connect my Git repository?

## GitHub

Click **Connect GitHub**, then install the Hodifly app on the account or organization that owns your repositories, choosing which repositories to grant access to.

Your repositories then appear automatically when you create a new project.

## GitLab (gitlab.com and self-hosted)

Unlike GitHub, there's no app to install. Here are the three steps to connect your GitLab, whether it's on gitlab.com or self-hosted:

|| Your self-hosted GitLab must be accessible on the internet and have a valid SSL certificate.

1. In GitLab, open your project › **Settings › Access Tokens**.
2. Create a token with ***role* Maintainer** and ***scope* **`api`.****
3. In the Hodifly new project form, choose **GitLab**, paste your **project URL** (for example `https://gitlab.com/groupe/projet`), paste the token, then click **Validate**.

Hodifly verifies the token and configures your project so it can be used on Hodifly.

### My GitLab token is about to expire. What happens?
Hodifly notifies you by email **about 30 days before** it expires (then again as the deadline approaches, and once the token has expired), and shows a warning on the project with an **Update Token** link. Click it and paste a new token. If several projects share this token, a single update renews all of them.

### Why does the GitLab token need the `api` scope and the Maintainer role?
Because Hodifly needs to **create a webhook** to receive GitLab notifications, and to publish **commit statuses** as well as **merge request preview links** (`api`).
