> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bijection.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Branches

> Stage changes in a writable world over a version, review exactly what changed, and land it at the head.

Every read and write happens in a **world**. The head is the current one. A
**version** is a world as one commit left it, read-only. A **branch** is a writable world
over a version: it reads what its parent held when it began and keeps its own
writes, while the head and other branches go on.

| World | `ctx.frame.in` | What you can do |
| - | - | - |
| The head | `null` | Read and commit. Performers act on tasks only here. |
| A branch | the `Branch` | Read the parent's facts as of the fork, stage writes, read what changed |
| A version | the `Version` | Read one past version, while `history` or a pin keeps it |

A mutation at the head opens a branch with `ctx.branch({ from, until })`,
admitted within the installation's retention from its cut (without `until`,
it lives to the end of retention; see
[History and lifetime](https://docs.bijection.com/database/history-and-lifetime.md#pins)). A
client then calls the same functions in it with `client.in(branch)`, under the
installed code and the caller's own authority: a branch grants no access.
`ctx.land(branch, { seen, then })` applies the branch to the head once someone
has reviewed it, and `ctx.discard(branch)` ends it without landing.

Use a branch to prepare a correction or a decision for review. To exercise a
real performer, use the head of a separate
[development deployment](https://docs.bijection.com/operate/installations/environments.md): tasks staged in a
branch are performed only once it lands.

* [Branch workflow](https://docs.bijection.com/branches/workflow.md): one example from open to land, with
  server and client code.
* [Create and use a branch](https://docs.bijection.com/branches/lifecycle.md): open, select, keep and
  discard a branch.
* [Read other versions](https://docs.bijection.com/branches/comparison.md): read and replay past versions
  and compare them.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.