Once your GitHub account is connected, you can export your project and keep it in sync as your app evolves.
Exporting for the first time
If you haven't connected GitHub yet, follow the steps in GitHub Export – Overview & Setup first.
When you complete the GitHub authorization flow, your first export is queued automatically. Caffeine shows a confirmation dialog titled "Export queued" with a message confirming your code will be synced to GitHub within a few minutes. The repository is created and the initial commit is pushed in the background.
Choosing a repository name:
Before the first export, you can type a name for the repository. The field is pre-filled with a sanitized version of your project name. Repository names can only contain lowercase letters, numbers, and hyphens, and must be 100 characters or fewer.
Exporting again after changes
Every time the AI builds a new version of your app, you can push that version to GitHub:
- Open the project settings (gear icon in the chat panel).
- Select Export to GitHub.
- Click Sync to GitHub.
After you click, Caffeine queues the export and shows a confirmation dialog titled "Queued for export to GitHub" with the message "Your changes will typically be exported to GitHub within 5 minutes." This means the export has been accepted but is not yet complete — it runs in the background while you keep working. Caffeine also posts a message in your chat confirming the export has been queued, along with the repository URL. When the export finishes, another message appears in chat to confirm it completed successfully. If something goes wrong, you will also see a message in chat explaining what happened with a prompt to try again.
While an export or import is in progress
When a GitHub export or import is running, the GitHub settings panel shows a spinning indicator and the message "Export to GitHub is in progress…" or "Import from GitHub is in progress…". The action buttons — Sync to GitHub, Disconnect, and Import from GitHub — are disabled while the operation is running, so you cannot accidentally start a second one at the same time.
Once the operation finishes, the indicator disappears and the buttons become active again. You do not need to keep the panel open — the status is tracked on Caffeine's side, so it reflects accurately even if you close and reopen the settings.
Caffeine pushes a new commit to the main branch of your repository. No new branch is created — all commits go to main. If the new build produced no file changes compared to the previous export, no commit is created.
Each export creates a single commit. For subsequent exports, Caffeine automatically writes a commit message that summarizes what changed, based on your recent conversation and the updated specification. This means your commit history gives a readable account of how the app developed.
Branch and repository structure
All exports target the main branch. Caffeine does not create separate feature branches or tags.
The files in the repository are organized exactly as Caffeine generates them:
- Backend code is in
src/backend/ - Frontend code is in
src/frontend/ - The app specification is at
src/spec.md - Image and asset files are in
frontend/public/assets/
Exporting to an existing repository
If you type the name of a repository that already exists in your GitHub account, Caffeine will push a new commit on top of the existing history rather than creating a new repository. This is useful if you want to maintain continuity with a repository you've already been working with.
What happens in GitHub
Each export creates one commit in your repository. You can view the full commit history in GitHub — including the AI-written commit messages — to see how your app has changed over time. The code in the repository is standard Motoko (backend) and React/TypeScript (frontend), so you can browse, clone, or fork it like any other GitHub repository.
Keeping your repository up to date
Caffeine does not automatically push to your personal GitHub repository when a new build completes. Each sync is triggered manually by clicking Sync to GitHub. If you want to keep GitHub in sync with your latest build, remember to push after each session.
Importing code from GitHub
If your project is already connected to a GitHub repository, you can import code back from GitHub into Caffeine. This is useful when you have edited the exported code directly in GitHub and want to bring those changes back into your Caffeine project.
Only code that has previously been exported from Caffeine can be imported — GitHub Import does not support importing arbitrary repositories.
To import:
- Open the project settings (gear icon in the chat panel).
- Click the More button (the ellipsis icon) to open its menu.
- Select Import from GitHub.
- Optionally, enter a git ref — a branch name, tag, or commit hash — to import from a specific point in your repository history. Leave this field blank to import from the default branch.
- Click Import from GitHub to start the process.
Import runs in the background and typically takes a few minutes. When you trigger an import, Caffeine immediately posts a message in your project chat to confirm it has started (for example, Importing main from https://github.com/owner/repo...). Once the import finishes, you will see a message confirming completion (for example, Import from GitHub from https://github.com/owner/repo complete, draft version 7 created.) or a message describing what went wrong — so you always know the outcome without staying on the page.
Frequently asked questions
Why did my export not create a commit?
If the current build is identical to the last export — no files changed — Caffeine skips the commit. This can happen if you triggered an export twice without running a new build in between.
Can I push to a branch other than `main`?
No. All exports commit to the main branch. Branch selection is not currently supported.
Can I control the commit message?
No. For subsequent exports, Caffeine writes the commit message automatically based on your recent conversation and specification changes. For the initial export, the message is always Initial commit — Exported from Caffeine.
The repository name I want is already taken in my GitHub account. What happens?
If you type the name of an existing repository, Caffeine pushes a new commit on top of that repository's existing history instead of creating a new one. Make sure this is what you intend before confirming.
I exported to the wrong repository. Can I change it?
You can disconnect GitHub Export and reconnect it, then type a different repository name during setup. This will create a new repository with the full history exported again from scratch. The old repository remains in your GitHub account — you can delete it there manually.
Does my commit history in GitHub persist if I rebuild the app in Caffeine?
Yes. Each export adds a commit on top of the existing history. Rebuilding your app in Caffeine does not reset or affect your GitHub repository until you manually push a new export.
Can I import code from a GitHub repository I did not export from Caffeine?
No. GitHub Import only works with code that has previously been exported from the same Caffeine project. It is designed for round-tripping code you have edited in GitHub back into Caffeine, not for importing arbitrary repositories.
What happens after a successful import?
A new draft is created with the imported code and begins deploying automatically. You will see a message about the new draft in the chat once you close the import dialog.