> Keep a collection in a GitHub repo as Markdown, in step both ways. An admin connects GitHub in Workspace settings, then pick a repo in the collection.

# Sync a collection with a GitHub repo

Sync keeps a collection in a GitHub repo, with each memo saved as a Markdown file. Changes in Fieldwerk reach GitHub within a minute, and edits pushed to the sync branch come back into the memos. A workspace admin connects GitHub to the workspace once; after that, anyone who can manage a collection can sync it to a repo.

## Connect GitHub to the workspace

A workspace admin does this once for the workspace.

1. Open **Workspace settings** and choose **Git sync**.

2. Click **Connect** with the workspace's name, and confirm.

3. On GitHub, install the Fieldwerk app on your account or organisation and choose which repositories it can use.

You're brought back to **Git sync**, which shows the connected GitHub account and its **Sync history**. See [Manage your workspace settings](https://help.fieldwerk.ai/uqqr752blk/manage-your-workspace-settings.md).

## Sync a collection

1. Open the collection, then open **Collection settings** and choose **GitHub and export**.

2. Under **Repository**, choose the repo.

3. Choose how changes arrive in the repo:

   - **Sync branch.** Fieldwerk commits to a branch called `fieldwerk-sync`, and you merge it into main when you're ready.

   - **Pull request.** Fieldwerk opens a pull request into main for you to review and merge.

4. Click **Connect**.

The tab then shows the repo, how changes arrive and when it last synced. Click **Sync now** to sync straight away.

## How changes flow

- Each memo in the collection is saved as a Markdown file in the repo.

- Changes made in Fieldwerk, by people or by an AI, reach GitHub within a minute.

- Edits pushed to the `fieldwerk-sync` branch come back into the memos. In a memo's history they show as made via GitHub, so you can see what came from the repo and restore an earlier version if you need to. See [See and restore earlier versions of a memo](https://help.fieldwerk.ai/pncsjucznc/see-and-restore-earlier-versions.md).

## Change or stop syncing

In the collection's **GitHub and export** tab, open **GitHub sync options** and choose **Change repository** or **Disconnect**. Disconnecting stops the sync and leaves the repo itself untouched.

## Working in the repo with a coding tool

Once a collection syncs, coding tools such as Claude Code can read the memos as files in the repo. To have them write plans and decisions back into Fieldwerk, connect them to Fieldwerk too; see [Connect other AI tools to Fieldwerk](https://help.fieldwerk.ai/ncqwmkwsa2/connect-other-ai-tools-to-fieldwerk.md). To keep a collection as a folder on your Mac instead, see [Sync a collection to a folder on your Mac](https://help.fieldwerk.ai/8xgcrllyuo/sync-a-collection-to-a-folder.md).
