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

# Set up Git sync

> Connect a repo-backed hub so Inkly can publish demos as code.

Git sync is the platform side of Demo as Code. Your hub is a Git repository with `inkly.json`, a `demos/` folder, and one `demos/<slug>/demo.config.json` file for each demo. Inkly publishes the hosted hub from that repo, so demos can move with the same workflow as product changes.

By default, Inkly can host a private repo for you. You can start there with no GitHub setup, then later clone the hub into your own GitHub account, download it as a ZIP, or connect a repo you already own.

<CardGroup cols={2}>
  <Card title="Use an Inkly-hosted repo" icon="cloud">
    Start quickly with a private repo managed by Inkly. You can move the hub to your own GitHub later.
  </Card>

  <Card title="Bring your own GitHub repo" icon="code-branch">
    Connect a repo under your GitHub account or organization and keep GitHub as your system of record.
  </Card>
</CardGroup>

## What gets synced

Inkly reads `inkly.json`, demo folders, demo configs, copy, annotations, and committed assets from the connected repo.

Managed assets can live in Inkly storage instead of GitHub. This is optional and mainly keeps large images, videos, and audio files out of your repo.

## Start with an Inkly-hosted repo

Choose **Inkly hosts it** for the fastest setup. Inkly provisions a private repo for your hub, so you can capture, edit, publish, and manage demos before installing the GitHub app.

This is still Demo as Code. Your hub has a repo behind it, even when Inkly hosts that repo for you.

## Move hosted content to your GitHub

When you are ready to own the repo directly, open **Settings** → **GitHub** and click **Connect**.

<Steps>
  <Step title="Choose how to migrate">
    Pick **One-click clone** to copy your existing hub into a new private GitHub repo automatically. Pick **Download content as zip** if you want to move the files manually.
  </Step>

  <Step title="Authorize GitHub">
    Click **Authorize with GitHub** and install or sign in to the Inkly GitHub app.
  </Step>

  <Step title="Choose the destination">
    Select the GitHub organization and name the new repo. Inkly copies your hub to the default branch of that repo.
  </Step>

  <Step title="Confirm the connection">
    After the repo is connected, Inkly publishes your hosted hub from the branch you choose.
  </Step>
</Steps>

## Bring your own GitHub repo

<Steps>
  <Step title="Open GitHub settings">
    In Inkly, open **Settings** → **GitHub**.
  </Step>

  <Step title="Choose your repo option">
    Click **Bring my own GitHub repo**.
  </Step>

  <Step title="Authorize GitHub">
    Click **Authorize with GitHub**. If the Inkly GitHub app is already installed, use **Already installed Inkly? Sign in instead**.
  </Step>

  <Step title="Pick an installation">
    If you have access to multiple GitHub accounts or organizations, choose the installation that owns the hub repo.
  </Step>

  <Step title="Create or select a repo">
    Use **Create new** to create a private repo with starter files, or use **Use existing** to connect a repo that already contains your hub.
  </Step>

  <Step title="Select the branch">
    Choose the branch Inkly should publish from. Most teams use `main`.
  </Step>

  <Step title="Set a hub directory if needed">
    If `inkly.json` is not at the repo root, turn on **inkly.json is in a different directory** and enter the directory path.
  </Step>

  <Step title="Open the hosted hub">
    After Inkly reads the repo, open the hosted hub URL and confirm your demos appear.
  </Step>
</Steps>

## Publish updates

After sync is set up, changes merged to the connected branch are automatically published or updated on the platform.

You can make changes locally, preview them with the CLI, and merge them to the connected branch. You can also edit a demo in the no-code editor. Inkly saves supported edits back to the repo so the repo remains the source of truth.

## When to use snapshots instead

Use a snapshot when you want to share one frozen demo without changing the live hub. Use a synced hub when your public demo site should track the source repo.

For CLI publishing workflows, see [Publish a collection of demos](/cli/publish-a-demo-hub) and [Publish a demo](/cli/publish-a-snapshot).
