> ## Documentation Index
> Fetch the complete documentation index at: https://ayakaleaf-pro.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# GitHub Synchronisation

> Link your GitHub account, import or export a project, sync changes both ways and unlink.

Connect a project to a GitHub repository. Changes go both ways, and only when you click **Sync**: nothing syncs on its own.

> [!NOTE]
>
> If you see no GitHub option in **Account settings** or in the editor, ask your administrator to turn on [GitHub Synchronisation](https://ayakaleaf-pro.mintlify.site/on-premises/configuration/overleaf-toolkit/integrations/github-synchronisation.md).

## Link your GitHub account

You do this once.

**1. Open your account settings**

Click **Account**, then **Account settings**. Scroll to **GitHub** and click **Link**.

![The GitHub section of the account settings with a Link button](https://mintcdn.com/ayakaleaf-pro/IsGnx0wnzqtV4hI8/images/on-premises/github-sync-link.png?fit=max\&auto=format\&n=IsGnx0wnzqtV4hI8\&q=85\&s=8812ab1604914a8aa6c1f0937f0e1b2e)

GitHub in the account settings

**2. Authorize on GitHub**

GitHub opens. Sign in if you are asked to, then authorize the application.

**3. Check the link**

You are back in the account settings, and the button now says **Unlink**.

![The GitHub section of the account settings with an Unlink button](https://mintcdn.com/ayakaleaf-pro/IsGnx0wnzqtV4hI8/images/on-premises/github-sync-linked.png?fit=max\&auto=format\&n=IsGnx0wnzqtV4hI8\&q=85\&s=910b756aa0adea66bda5bb2e5776214e)

Your GitHub account is linked

If your account is not linked yet, **Import from GitHub** and the **GitHub** card in the editor ask you to link it first. Click **Link to your GitHub account**. You also end up in the account settings, in a new tab if you started in the editor. Then go back and start again.

![The Import from GitHub dialog with a Link to your GitHub account button](https://mintcdn.com/ayakaleaf-pro/IsGnx0wnzqtV4hI8/images/on-premises/github-sync-link-prompt.png?fit=max\&auto=format\&n=IsGnx0wnzqtV4hI8\&q=85\&s=05546893169a57f837a8938f904db194)

The prompt when your account is not linked

## Import a repository

This creates a new project from a GitHub repository, already linked to it.

**1. Open the import dialog**

On the projects page, click **New project**, then **Import from GitHub**.

![The New project menu with Import from GitHub](https://mintcdn.com/ayakaleaf-pro/IsGnx0wnzqtV4hI8/images/on-premises/github-sync-new-project-menu.png?fit=max\&auto=format\&n=IsGnx0wnzqtV4hI8\&q=85\&s=384e6663f982016a5c295f35c4709413)

The New project menu

> [!NOTE]
>
> **New project** appears once you have a project. The **Create a new project** menu on the welcome page has no import, so create a blank project first.

**2. Choose the repository**

Click **Import to Overleaf** next to the repository. The list includes your repositories and those of your organizations.

![The Import from GitHub dialog listing four repositories](https://mintcdn.com/ayakaleaf-pro/IsGnx0wnzqtV4hI8/images/on-premises/github-sync-import.png?fit=max\&auto=format\&n=IsGnx0wnzqtV4hI8\&q=85\&s=54a0bd11655ddbfad4ae16e5e7473b74)

Your GitHub repositories

If an organization's repository is missing, click **Can't see what you're looking for?** for GitHub's help on approving the application for that organization.

**3. Check the project**

The new project opens with the files of the repository.

![The editor showing the imported project with its files and compiled PDF](https://mintcdn.com/ayakaleaf-pro/IsGnx0wnzqtV4hI8/images/on-premises/github-sync-imported.png?fit=max\&auto=format\&n=IsGnx0wnzqtV4hI8\&q=85\&s=90dfe6947c2e0ed420abfc8c81992768)

The imported project

## Export a project to a new repository

This creates a repository from a project you own and links them. A project can only be linked this way or by importing: you cannot link it to a repository that already exists.

**1. Open GitHub in the editor**

Open the project. In the left bar, click **Integrations**, then **GitHub**.

![The Integrations panel with the GitHub card](https://mintcdn.com/ayakaleaf-pro/IsGnx0wnzqtV4hI8/images/on-premises/github-sync-integrations.png?fit=max\&auto=format\&n=IsGnx0wnzqtV4hI8\&q=85\&s=5c96ec0031a5940c337393254b06e0d3)

The Integrations panel

**2. Fill in the repository**

Choose the **Owner**, which can be you or one of your organizations. **Repository Name** starts as the project's name. The description is optional, and **Private** is selected by default. Click **Create a GitHub repository**.

![The Export Project to GitHub form filled in](https://mintcdn.com/ayakaleaf-pro/IsGnx0wnzqtV4hI8/images/on-premises/github-sync-export.png?fit=max\&auto=format\&n=IsGnx0wnzqtV4hI8\&q=85\&s=24bd26a171943d43efaa3c4aed69d1e8)

Export Project to GitHub

**3. Check the link**

The dialog now says **This project is linked to** and names the repository.

![The Sync with GitHub dialog after the export](https://mintcdn.com/ayakaleaf-pro/IsGnx0wnzqtV4hI8/images/on-premises/github-sync-exported.png?fit=max\&auto=format\&n=IsGnx0wnzqtV4hI8\&q=85\&s=93ebf2c62d4a34c7d2c41ffbca9d0740)

The project is linked

## Sync

**1. Open the sync dialog**

Open a linked project. In the left bar, click **Integrations**, then **GitHub**.

**Recent commits in GitHub** lists what will come into the project.

![The Sync with GitHub dialog listing one new commit](https://mintcdn.com/ayakaleaf-pro/IsGnx0wnzqtV4hI8/images/on-premises/github-sync-new-commits.png?fit=max\&auto=format\&n=IsGnx0wnzqtV4hI8\&q=85\&s=6a3c23a6993f04d0fa818bceb565ce3e)

A new commit waiting in GitHub

**2. Describe your changes**

If you changed something in the project, a commit message box appears. It is optional: when you leave it empty, the commit is called `Updates from Overleaf`.

![The Sync with GitHub dialog with a commit message filled in](https://mintcdn.com/ayakaleaf-pro/IsGnx0wnzqtV4hI8/images/on-premises/github-sync-commit-message.png?fit=max\&auto=format\&n=IsGnx0wnzqtV4hI8\&q=85\&s=b3fe2cbcae8335c7363fcd220d2b993c)

The commit message for your changes

**3. Click Sync**

Click **Sync**. New commits from GitHub come into the project, and your changes go to the default branch of the repository. If both sides changed different things, they are merged for you.

**4. Check the result**

The dialog shows **No new commits in GitHub since last merge.** and the commit message box is gone. The files in the editor and the commits on GitHub are up to date.

![The Sync with GitHub dialog after syncing, with no new commits](https://mintcdn.com/ayakaleaf-pro/IsGnx0wnzqtV4hI8/images/on-premises/github-sync-done.png?fit=max\&auto=format\&n=IsGnx0wnzqtV4hI8\&q=85\&s=851a620d8601a3ebaf9260f0f1c1685a)

Everything is in sync

### If the same lines changed on both sides

The dialog says the changes could not be merged and names a new branch, `overleaf-YYYY-MM-DD-HHMMSS`, which holds your changes.

![The Sync with GitHub dialog with a merge conflict warning](https://mintcdn.com/ayakaleaf-pro/IsGnx0wnzqtV4hI8/images/on-premises/github-sync-conflict.png?fit=max\&auto=format\&n=IsGnx0wnzqtV4hI8\&q=85\&s=b67dd69bb98605672da34b3a372be582)

A conflict

1. Merge that branch into the default branch on GitHub or with Git. You can close the dialog in the meantime: it shows the same message when you open it again.
2. Click **I have manually merged. Continue**. The merged result comes into the project.
3. The branch stays on GitHub. Delete it when you no longer need it.

## Unlink a project

Do this when you no longer want the project to sync. Only the project owner can.

**1. Click Unlink**

In the sync dialog, click **Unlink**.

**2. Confirm**

Click **Confirm**. The note about a subscription does not stop you from linking the project again.

![The Sync with GitHub dialog asking to confirm the unlink](https://mintcdn.com/ayakaleaf-pro/IsGnx0wnzqtV4hI8/images/on-premises/github-sync-unlink-project.png?fit=max\&auto=format\&n=IsGnx0wnzqtV4hI8\&q=85\&s=e2f2e541c2e9e8d000baa0dacd28a328)

Confirm the unlink

**3. Check the result**

The dialog now shows **Export Project to GitHub**. The project and the repository both keep their content. To sync again, export the project to a new repository, or import the repository into a new project.

## Unlink your GitHub account

In **Account settings**, under **GitHub**, click **Unlink**, then **Unlink** again in the dialog.

![The Unlink GitHub Account dialog](https://mintcdn.com/ayakaleaf-pro/IsGnx0wnzqtV4hI8/images/on-premises/github-sync-unlink-account.png?fit=max\&auto=format\&n=IsGnx0wnzqtV4hI8\&q=85\&s=94ce090cb4d8b98231886319d6e6d903)

Unlink your account

Your projects stay linked to their repositories. You cannot sync them until you link your account again.

> [!NOTE]
>
> For who can do what in a shared project, see [Who can link and sync](https://ayakaleaf-pro.mintlify.site/on-premises/configuration/overleaf-toolkit/integrations/github-synchronisation.md#who-can-link-and-sync). Every collaborator who syncs links their own GitHub account.


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