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

# Code Sync

> Automatically sync your site's branches to connected repositories.

Code Sync keeps your site's code updated in connected repositories. GitHub is currently available. Each repository has its own status, and a conflict on one branch does not stop the others.

Code Sync appears in Advanced settings when it is available for your organization.

## Connect a repository

You need permission to manage the site and write access to the destination repository.

1. Open **Settings** → **Advanced settings** → **Code Sync**.
2. Select **Add connection**, choose **GitHub**, and connect your account. Complete authorization in the same browser where you started.
3. Choose your GitHub account or organization. If needed, install the Fimo App and give it repository access. GitHub returns you to the same connection in Fimo. An organization owner may need to approve installation first.
4. Create a repository or select an existing one. New repositories are **Private** by default. Choose **Public** only if you want the code and history of all current and future site branches to be publicly visible.
5. Connect the repository. The setup panel closes and sync starts automatically. Follow its progress in the connection list.

Existing repositories appear newest first. After granting access to another repository in GitHub, select **Refresh repositories** to update the list.

Fimo includes your current Branches and automatically adds new ones, keeping their names. Temporary agent work is excluded. The Branch you publish from, usually `main`, is included; publishing does not create an extra synced branch. Switching the Branch you view in Studio does not change what syncs.

Add another connection to keep the same branches updated in another repository. Existing GitHub branches that Fimo has never synced stay untouched and require attention before Fimo can use their names. Other branches can sync meanwhile.

> [!NOTE]
>
> Code Sync sends Git-tracked code and history from Fimo to the destination. Changes made in GitHub do not return to
> Fimo. It does not back up your platform data, media library, form submissions or Environment secrets.

## Check progress

Open a connection to see each branch's status. New branches with no code wait for their first commit. Branches waiting for their first commit do not prevent other branches from showing as up to date.

Spinners show when Fimo is connecting, refreshing repositories, checking access, creating a repository or stopping sync. Wait for the action to finish; if it fails, you can retry from the same connection. Warning panels highlight errors and conflicts, with the reason and recovery steps.

Deleting a Branch in Fimo stops its sync but keeps the branch in GitHub. If you recreate the same name in Fimo with different history, preserve the old GitHub branch by renaming it, then use **Check and resume** to sync the recreated branch. Fimo does not silently replace the old history.

If Code Sync is disabled for your organization, automatic sync stops while your connections and sync history are kept. When access is restored, eligible branches continue syncing. Conflicts still need **Check and resume**.

## When a branch needs attention

**Branch already exists:** Fimo has never synced this branch, and its name is already used in GitHub. To preserve the existing branch, rename it in GitHub, then select **Check and resume** so Fimo can create the missing name. Connecting a new, empty repository is another option.

**Conflicting changes:** Fimo pauses only the affected branch. Preserve the external work on another branch, then ask a developer to restore the connected GitHub branch to the exact last synced commit shown in Code Sync. This changes that branch's history; Fimo does not perform the repair. Reverting file contents creates a different commit and is not sufficient. **Check and resume** reports whether sync resumed or remains paused, with the reason. It keeps the branch paused until the checks pass. If repository rules prevent restoration, connect a new repository.

**Access required:** restore the Fimo App's access to the selected repository, then use **Check access** or reconnect. Fimo keeps your connection and resumes eligible branches. Existing branch conflicts still need their own **Check and resume**.

**Repository rules:** if GitHub rejects a push, review its branch rules and security alerts. After correcting the cause, use **Check and resume**. Fimo does not bypass GitHub protections.

**Temporary errors or rate limits:** Fimo retries after the required delay. Repeated clicks or new edits do not shorten that delay.

**Repository creation failed:** check the selected account and repository name, then try again. If creation could not be confirmed, inspect GitHub before starting again to avoid creating a second repository.

Unsupported Git features, including Git LFS or submodules, and exceeded sync limits show an error instead of silently omitting files. After correcting the cause, use **Check and resume** to recheck the branch.

## Remove and reconnect

**Remove connection** stops future syncs and removes its access credentials from Fimo. The GitHub repository and its branches remain intact.

Reconnect the same repository to the same site and organization to recover its previous sync history after authorizing access again. Fimo checks for changes made while disconnected and preserves unresolved conflicts. A different site or organization cannot reuse that sync history.


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