> For the complete documentation index, see [llms.txt](https://docs.rierino.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rierino.com/devops/branching-and-migration.md).

# Branching & Migration

This section covers how Rierino handles change isolation, release movement, and recovery. It lets teams develop in parallel on a shared environment, merge selected assets, move changes between environments, and restore earlier versions when needed.

### What this section covers

* [Managing Branches](/devops/branching-and-migration/managing-branches.md) explains Rierino’s branch model, branch-aware development, selective merges, and how branches are accessed from the UI and APIs.
* [Migrating Changes](/devops/branching-and-migration/migrating-changes.md) covers online migration, offline export and import, CI/CD-based promotion, and bulk database migration tradeoffs.
* [Rolling Back Changes](/devops/branching-and-migration/rolling-back-changes.md) explains how to restore selected assets to an earlier snapshot using history states.

### How the workflow fits together

1. Create a branch for isolated changes.
2. Build and test updated assets on that branch.
3. Merge selected branch assets into main.
4. Migrate approved changes to target environments.
5. Roll back specific assets if a release needs correction.

This flow supports smaller releases. It also avoids full-environment promotion when only a subset of assets is ready.

### Key ideas

#### Branches run on the same environment

Rierino branches do not require separate deployments. Users and API clients can switch branches directly on the shared environment.

This makes branch testing faster. It also reduces infrastructure overhead.

#### Merges and migrations are selective

You can choose specific assets instead of moving everything together. This is useful for micro-releases and staged rollout.

#### Rollback depends on historical snapshots

Rollback works by restoring the latest snapshot before a chosen date. This relies on history states being available for the relevant domains.

### Common use cases

* Build a new saga or query on a feature branch without affecting main.
* Test branch-specific UI and API behavior through the admin UI or headers.
* Merge only one API, query, or model from a larger branch.
* Export a release package when environments cannot connect directly.
* Revert a subset of released assets after a bad deployment.

### Start here

* Start with [Managing Branches](/devops/branching-and-migration/managing-branches.md) if you need parallel development.
* Go to [Migrating Changes](/devops/branching-and-migration/migrating-changes.md) when moving approved assets to test or production.
* Go to [Rolling Back Changes](/devops/branching-and-migration/rolling-back-changes.md) when you need targeted recovery after release.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.rierino.com/devops/branching-and-migration.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
