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

# GitHub & GitLab

> Keep your Site and a repository in sync, both ways.

Link your Site to a GitHub repository or a GitLab project and every change syncs both ways. Each turn your AI teammate
takes becomes a commit, and whatever you push to the branch comes back into your Site.

Astro and plain-HTML sites can be synced. For a site built with another framework, use
[Move a Website](https://docs.boostgpt.co/site/move-a-website.md), which rebuilds it in Astro. See [How Your Site Is Built](https://docs.boostgpt.co/site/how-its-built.md).

## Connect a repository

You can start a new Site from a repository, or link an existing Site.

**1. Open Repository**

Choose **GitHub / GitLab** in **New Site**, or open your Site's **Settings → Repository**.

**2. Sign in**

On GitHub, install the BoostGPT app and give it access to your repositories. On GitLab, sign in. You need the
Maintainer role on the project.

**3. Choose the repository**

Pick the repository, the branch and, if your site lives in a folder, that folder.

Only workspace owners and admins can change a Site's repository.

![A Site linked to a GitHub repository.](https://mintcdn.com/boostgpt-24074986/acunUA0oSYsGxvUc/images/app/repository.png?fit=max\&auto=format\&n=acunUA0oSYsGxvUc\&q=85\&s=195a85f702bcdb9a76f2679f69c1281d)

A Site linked to a GitHub repository.

## What the first sync does

| Your repository | What happens |
| - | - |
| **Holds an Astro or plain-HTML site** | The repository replaces your Site's files. What your Site held stays in version history. |
| **Is empty, or only has a README or licence** | Your Site is pushed into it. |
| **Holds anything else** | The sync stops and says why. Nothing changes. |

## After a push

Pushed changes come into your Site and it builds on its own, so your preview catches up. If the changes don't build, the
error appears in **Settings → Repository** and you get a notification. Push a fix, press **Sync now**, or ask Mira to
fix it.

Pushes never change your live Site by themselves. You choose when to [publish](https://docs.boostgpt.co/site/publishing.md).

## When both sides change

If a file changed in your repository and in BoostGPT, nothing is lost. Your Site takes the repository's version, and
BoostGPT's version goes on a side branch with a pull or merge request, so you can merge what you want to keep.

## Good to know

* **A secret key is never pushed.** If one is found in a file, the sync stops and names the file.
* **Build output stays out of your repository,** and files your `.gitignore` covers are left alone on both sides.
* **Your plan's limits apply.** A pull that wouldn't fit is refused, and nothing is synced.
* **Pause** stops syncing. Resuming catches up on both sides.
* **Disconnecting deletes nothing** on either side.

[Automations](https://docs.boostgpt.co/mira/automations.md) can run when changes sync, when a conflict appears, or when a sync fails.


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