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

# Manage your GitHub sync

> Check how your website’s code syncs with GitHub, then fix, change or stop the sync to keep your code where you want it.

Check, fix or stop your website’s sync with [GitHub](/build/github), and pick its branch.

## Before you start

Members can use the GitHub tool, switch branches and download code. To disconnect a website or change a connection, you need the owner or admin [role](/account/team). View-only teammates don’t see the tool.

**1. Open the GitHub tool**

In Build, press **Tools**, then **GitHub**. At the top, a line says how the sync stands. Below it, you see when it last synced and checked.

**2. Read how it stands**

* In sync: both sides have the same code.
* Foundable ahead: its newer versions go to GitHub on the next sync.
* GitHub ahead: its newer commits haven’t come into Foundable yet.
* Diverged: each side has changes the other doesn’t.

If the tool can’t tell how they compare, the line says so.

**3. Check again**

Press the round arrows at the top right (**Re-check sync status**). If GitHub doesn’t answer, try again later. An archived repository can’t take new commits. Unarchive it on GitHub, then check again.

## Change or stop the sync

* **For developers**: under **Branch**, search for the branch to sync with. Or press **Create branch** and type a **Branch name**. You can’t switch while Ted is editing the website. Under **Clone**, copy the address for **HTTPS**, **SSH** or **GitHub CLI**.
* **Disconnect from GitHub**, the last card, stops the sync. Type the repository’s name, then press **Disconnect**. A note confirms it. Your code stays in both places.

In **Settings** › **Git**, each connection shows its websites, owner and last update. Open one to press **Configure on GitHub** for the app’s settings there. To stop websites syncing, tick them under **Linked websites** and press **Unlink**. **Delete this connection** disconnects all its websites. Press **Delete** and type its name.

## If something goes wrong

> **“Your latest changes could not be pushed to the synced branch”**
>
> GitHub didn’t take your latest versions. The message says why. Maybe a rule on GitHub protects the branch. Or someone pushed newer commits that Foundable couldn’t combine with yours. Your versions went to a branch named `foundable-sync`. Merge it into your synced branch on GitHub.

> **“A repository push replaced your Foundable work”**
>
> Your earlier work waits in a backup. Only the owner can restore it. Press **Review restore**, then **Restore Foundable work**. **Keep repository version** keeps GitHub’s instead. Your work stays in the backup. **Decide later** waits.
>
> After a restore, your work syncs back to GitHub. If GitHub has newer changes, your work goes to a separate sync branch. Merge it into your main branch on GitHub (**Merge on GitHub**). If you don’t, your next push can replace it again.

> **“Connection lost to …”**
>
> Foundable can’t reach the repository. Someone may have paused or removed the Foundable app on GitHub. Then **Settings** › **Git** marks the connection **Suspended** or **Uninstalled**. Press **Reconnect**. Or disconnect the website and connect it again, which makes a new repository.

## FAQ

> **Which files stay on GitHub?**
>
> The GitHub tool lists files that never come into Foundable, like `.env` files, credential files, links and submodules. It doesn’t list a `node_modules` folder, which stays out too. Keep secrets in [Secrets](/build/secrets) instead.

> **What happens to the repository if I delete my website?**
>
> It [stays on GitHub](/build/manage-websites#rename-duplicate-or-delete-a-website), as it does when you disconnect a website or delete a connection.

## Related

> **[Keep your website’s code in GitHub](/build/github)**
>
> Connect GitHub, then a website.

> **[Add your website’s secret keys](/build/secrets)**
>
> Keep keys in Secrets, not in your code.


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