---
title: Branches
description: Look over a branch, preview it, bring it up to date, and merge it to put it live.
sidebar:
  order: 3.5
---

Every change to your site's code waits on a branch until it is merged: its
pages, layouts, components, tables, stylesheet, language files, JavaScript files
and import map. Merging is how any of it goes live, unless somebody with
[git access](/dashboard/account/#git-access) pushes straight to `main`. The
Branches screen is where you look a branch over and decide.

The list shows every branch your site has besides the live site itself, the
most recently changed first. Each row says how many changes the branch would
put live, or that it has nothing new, whether it is behind the live site, and
when it last changed and who changed it. The changes you make on
[Pages](/dashboard/pages/) go on a branch called `draft`. A coding agent
usually names its branch after the task, such as `agent/opening-hours`.

## Look a branch over

Open a branch to see what it would change. It lists the branch's commits, each
with a short description of the change, and then every file it adds, changes
or deletes, with the lines it adds in green and the lines it removes in red.
Anything that went live after the branch started is left out, so it is never
shown as the branch taking it away.

Above the commits, **What changes** says in plain sentences what the branch
changes in what your site does, file by file, naming the block a sentence is
about where there is one. When the files differ but nothing they do has
changed, it says that instead. It is left out when the branch has an error,
which a merge would name, or when it could not be worked out just then.

**Preview** opens the whole site as the branch has it, at the site's preview
address, through a private link. A form sent there keeps its entry with the
branch and never reaches your tables
([more on previews](/dashboard/pages/#preview-and-publish)).

### What merging does to your tables {#tables}

Your tables are files of your site too, so a branch can change them, adding a
field for example. When it does, the screen lists above the buttons what
merging would do to your tables, one step at a time. A step that removes data
or lets more people see it is marked **Needs you**: a coding agent cannot put
it live, and **Merge and go live** on this screen approves exactly the list
you see. The same button on the Pages banner doesn't merge a branch that
changes your tables at all: it brings you here to see the list first. When the list can't be checked against your rows yet, or the change
can't go live as it is, the screen says so and merging won't go through.

### Scenarios {#scenarios}

Your coding agent can write scenarios for your site: short scripted checks of
what a visitor does and sees, kept as files under `tests/`. When a branch has
them, the screen plays them on the branch and lists each one as passing or
failing, with the line where it failed. Your agent can't merge the branch
until they all pass. You still can.

## Merge and go live

**Merge and go live** puts everything on the branch live at once, and visitors
see it straight away. The same button sits on the Pages banner while you are
on the branch there. Everything the branch changes is checked again first, and
if something on it would break the site, the merge is refused and the screen
says why. A merge that goes through can still come with a
[warning](/dashboard/pages/#branches-and-going-live) beside its confirmation,
which stops nothing.

Once it is merged, the branch is deleted. The next change you make on Pages
starts a fresh `draft`.

A merge has no undo button. To take a change back, open the page's history on
[Pages](/dashboard/pages/#use-history), restore the version you want, and merge
that.

## When the live site has moved on {#update}

If something else went live after a branch started, another branch being
merged for example, the branch has to catch up before it can be merged.
**Update from the live site** brings what went live into the branch. Check the
preview again, then merge.

When the branch and the live site both changed the same file, updating stops
and names the files rather than choosing between the two. Ask the agent that
wrote the branch to update it: it can see both versions and decide which
should win.

## Delete a branch

**Delete** throws a branch away after you confirm. Nothing on it has gone live,
so the live site does not change, and there is no undo.
