Test changes to your app on a branch before they go live

A branch is a copy of your app where Hercules builds a change without changing the version your team uses. Each branch gets its own backend and database, and nothing on it reaches your main app until you merge.

What can you do on a branch?

Test against a copy of your real data

Replicate production data starts the branch with a one-time snapshot of your production database, if your app has a production backend. Changes to that copy never reach production, because a merge carries only code and schema, the database's structure.

Branches
Create branch dialog with a branch name field and the Replicate production data toggle

Work on several changes side by side

One branch can rework dispatch while another adds a customer portal. New Chat in Branch opens a second chat that shares the branch's backend and code.

Branches
Code diff for a branch: two changed lines in the Spanish translation file

Review the change before you merge

The branch preview shows the change live as Hercules builds it. Code diff lists every file the branch changed compared to main.

Branches
Branch banner and preview header, each with a Merge button

Merge, or resolve conflicts first

Click Merge in the banner above the chat or in the preview header. When the branch and main changed the same thing, the banner lists the conflicting files, and you click Merge into main branch once Hercules resolves them.

Branches

Know which keys and jobs a branch uses

A branch gets every secret scoped to Development, and you can't scope a secret to one branch. Scheduled jobs in the branch's code run against the branch's own database.

Branches

How do you build a change on a branch?

  1. 1. Create the branch

    Open your app's preview to start your main dev session, which must be running before you create a branch. Click the branch icon next to New Chat, name the branch and turn on Replicate production data, and Hercules creates it with its own backend.

  2. 2. Describe the change

    Add a 2% late fee to invoices more than 30 days overdue, and show it as its own line on the invoice.

    Hercules changes the invoice code and schema on the branch. Check the fee on copies of real overdue invoices in the branch preview.

  3. 3. Merge, then publish

    Click Merge, and Hercules merges the branch into main. Publish soon after so the live pages match the merged backend.

    How to publish

What could this look like for a wholesaler?

In this hypothetical example, a building-supply wholesaler tests new volume-discount rules and a delivery-window picker on two separate branches of their Hercules app. The operations manager checks the discount rules against a copy of last month's orders, so a rule that overcharges shows up before a customer sees it. The delivery picker stays unmerged until it's ready.

Related features

Frequently asked questions

What should you know before you use branches?
  • Merging doesn't publish your app's pages. By default, merged backend changes go live on production the next time your main dev session starts. If your app has a separate development backend, Publish sends them instead. Branches
  • After a merge, Hercules deletes the branch's backend and database, so the branch preview stops.
  • Two chats editing the same file on one branch at once can lose edits. Multi-Agent
  • You can't delete or close a branch yet. Archive it from the Branches menu to hide its chats.
  • Each app can have up to 100 branches over its lifetime.
  • See what each plan includes on the pricing page.
Which version does Merge use?

Merge uses the latest saved version of the branch, after Hercules saves any unsaved changes and brings in the latest main. A merged branch is finished, and its chat can't continue.

Can I check main's latest changes before I merge?

Yes. Ask Hercules to bring main's latest changes into the branch, then check Code diff and the branch preview.

How do I stop a branch from sending real emails?

Scheduled jobs on a branch send real emails and messages. Before you test, ask Hercules to remove them on the branch, or pause the branch's backend from the Hosting screen. Environments

How is a branch different from version control?

Version control tracks every change to your main app so you can step back to an earlier point. A branch is a separate copy you build on alongside main, then merge in one step. Version control

How do you get started?

Pick one change you'd rather not try on the live app, such as a pricing rule, and build it on a branch. Start building.