Branching lets you fork an entire namespace — services, volumes, routing — into a new environment as a single atomic operation. The typical use case is creating an isolated environment for a pull request, then promoting it to production when the PR is approved. Every branch lineage fact is committed to the control plane as durable evidence of where each service revision came from.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/getployz/ployz/llms.txt
Use this file to discover all available pages before exploring further.
How branching works
When you branch a namespace, Ployz copies service configurations and optionally volumes from a source namespace into a new target namespace. Each resource can be either branched (copied from the source) or fresh (created independently in the target):Branch— the target resource starts from the source’s current revision or volume state.Fresh— the target resource is created independently, with no lineage link to the source.
Branch for services (so they inherit the source’s container spec) and Fresh for volumes (so the PR environment gets a clean data set rather than a live copy of production data).
Branch subcommands
| Subcommand | What it does |
|---|---|
branch preview | Computes the branch plan and prints it without making any changes |
branch prepare | Resolves the plan and saves it as a prepared deploy, but does not apply it |
branch apply | Previews, plans, and applies in one step |
branch apply-prepared | Applies a previously prepared branch deploy by its ID |
Flags
All branch subcommands (exceptapply-prepared) accept the same arguments:
| Flag | Default | Description |
|---|---|---|
--service-mode | branch | Default mode for services: branch or fresh |
--volume-mode | fresh | Default mode for volumes: branch or fresh |
--service NAME=MODE | — | Per-service mode override; repeatable |
--volume NAME=MODE | — | Per-volume mode override; repeatable |
Per-resource overrides
Use--service and --volume to override the mode for individual resources:
db volume is cloned from production (copy-on-write, instant), while the worker service gets a fresh empty instance instead of inheriting the production spec.
Typical workflow: preview → prepare → apply-prepared
For production environments, use the three-step workflow to separate the planning phase from the apply phase. This lets you inspect the plan and apply it later — for example, after a CI check passes — without the plan becoming stale:Preview the branch
Compute the plan and verify what will be created in the target namespace.The preview shows which services will be created, which volumes will be cloned or freshly provisioned, and which machines will participate.
Prepare the branch
Resolve and save the plan as a prepared deploy. The command prints the The prepared deploy is stored in the control plane and has a TTL. It will expire if not applied within the configured window.
prepared_deploy_id.Branch lineage is committed as a durable fact in the control plane. After a branch is applied, you can always trace which source namespace and source revision a branched service came from. Raw manifests are not stored as evidence, but the lineage records are.
Promoting to production
Promotion atomically switches traffic from one namespace to another. It is implemented through the deploy path: you apply a manifest in the target namespace that references the branched services, and the routing commit point flips traffic.Resource mode reference
| Mode | Services | Volumes |
|---|---|---|
Branch | Target service inherits the source’s container spec and revision. Lineage is recorded. | Target volume is a ZFS clone of the source — instant, copy-on-write. |
Fresh | Target service is created independently with no source lineage. | Target volume is provisioned as a new empty dataset. |
Next steps
Deploy
Understand the deploy phases and commit model that powers branch and promote.
Rollback
Restore a previous deploy point if a promotion goes wrong.