---
title: "Branches: preview copies of your schema | Backenly Docs"
description: Branches give a coding agent an isolated copy of your schema to build and test a change, compare it with production, then merge it back or throw it away.
url: https://backenly.com/docs/branches
markdown_url: https://backenly.com/docs/branches.md
updated: 2026-10-12
---

# Branches

Branches give your agent its own copy of your backend’s schema to build against, the way a pull request lets you try code before merging it. Production keeps serving while the branch changes, and merging replays the changes onto production.

In the console: Operate › Branches (Beta) · Operate · Updated October 12, 2026

## Why you need it

Changing a live backend is risky: a new column or table can break the app your users have open right now. A branch lets your agent try the change somewhere that cannot affect them, test it against its own preview endpoint, and show you the difference before anything reaches production.

For example:

- Your agent builds a coupons feature on a branch and tests it before it touches the live shop.
- You compare a branch with production to see exactly which tables and columns changed.
- An experiment did not work out. You discard the branch and production never saw it.
- A preview build of your frontend talks to the branch through a key bound to that branch.

## How it works

1. **Create a branch.** Backenly copies your schema into its own isolated space, with the same row-level security and its own id sequences. It starts empty unless you choose to copy the data too.
2. **Your agent changes the branch.** It passes the branch id to `apply_migration` and tests against the branch’s preview endpoint while production keeps serving.
3. **Review the difference.** The branch shows a schema diff against production, and warns you if production has changed since the branch was created.
4. **Merge or discard.** Merging replays the branch’s schema changes onto production, in order, after your approval. Discarding drops the copy and leaves production untouched.

## Try it

Ask your agent:

```text
Create a preview branch called coupons, add a coupons table on it, and show me the diff against production.
```

## Good to know

- Branches are in beta and available on Backenly Cloud.
- Discarding a branch deletes its copy and every row in it. It cannot be undone.

Previous: [Monitoring](https://backenly.com/docs/monitoring.md) · Next: [Deploy](https://backenly.com/docs/deploy.md)

---

Source: [Branches: preview copies of your schema | Backenly Docs](https://backenly.com/docs/branches). Every page in Markdown: https://backenly.com/index.md. Agent docs: https://backenly.com/llms.txt.
