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

# GitHub Sync

> Connect your app to a GitHub repository for two-way sync between Fabricate and GitHub.

GitHub Sync links your Fabricate app to a GitHub repository and keeps the two in step. Changes flow in both directions: what the AI agent builds in Fabricate lands in your repository, and commits you push to GitHub flow back into your Fabricate project.

## What Syncs

Once connected, your project and its repository stay aligned:

* **Fabricate to GitHub** — code the agent generates is committed to your repository.
* **GitHub to Fabricate** — commits you or your collaborators push to the repository flow back into your project.

This makes it practical to hand-edit code locally, collaborate with teammates through normal Git workflows, or keep a versioned history of your app — all without losing the ability to keep building in Fabricate.

<Note>
  GitHub Sync uses webhooks to detect changes on the repository side, so updates pushed to GitHub are picked up automatically.
</Note>

## Setting Up GitHub Sync

<Steps>
  <Step title="Open GitHub Sync for your app">
    In your Fabricate project, find the GitHub Sync option in the code management settings.
  </Step>

  <Step title="Authorize Fabricate with GitHub">
    Connect your GitHub account so Fabricate can access the repository you want to sync with.
  </Step>

  <Step title="Choose a repository">
    Select the GitHub repository to link to this app.
  </Step>

  <Step title="Confirm the connection">
    Fabricate sets up two-way sync, including the webhook that watches for changes pushed to the repository.
  </Step>

  <Step title="Build and push as usual">
    Keep prompting in Fabricate or commit directly on GitHub — changes stay in sync both ways.
  </Step>
</Steps>

## Sync vs. a One-Time Export

GitHub Sync is an ongoing connection. [Exporting your code](/build/export-code) is a one-time snapshot.

|                      | GitHub Sync                           | One-time export              |
| -------------------- | ------------------------------------- | ---------------------------- |
| **Direction**        | Two-way, continuous                   | One-way, single copy         |
| **Stays up to date** | Yes                                   | No — snapshot only           |
| **Uses webhooks**    | Yes                                   | No                           |
| **Best for**         | Ongoing development and collaboration | Grabbing a copy of your code |

Choose GitHub Sync when you want to keep working across both Fabricate and GitHub. Choose a one-time export when you just want a copy of your code as it stands.

## Frequently Asked Questions

<AccordionGroup>
  <Accordion title="Do I need an existing repository?">
    GitHub Sync connects your app to a GitHub repository. If you only want a fresh copy of your code in a brand-new repo, you can [push to a new repository](/build/export-code) instead.
  </Accordion>

  <Accordion title="Who owns the code in the repository?">
    You do. The repository is yours — Fabricate syncs to it, but there's no lock-in. See [Exporting Your Code](/build/export-code).
  </Accordion>

  <Accordion title="Can I edit code locally and have it show up in Fabricate?">
    Yes. That's the point of two-way sync — push commits to the connected repository and they flow back into your Fabricate project.
  </Accordion>
</AccordionGroup>

## Where to Go Next

<CardGroup cols={2}>
  <Card title="Export Code" icon="download" href="/build/export-code">
    Push to a new repo or download a zip.
  </Card>

  <Card title="File Explorer" icon="folder" href="/build/file-explorer">
    Browse the code that gets synced.
  </Card>
</CardGroup>
