Skip to main content
A theme branch is a private copy of a theme that you can change and preview without touching the live theme. Each theme has one branch, called staging. You publish your local theme files to staging with the Fluid CLI, open it on your real storefront through a preview link, share that link for review, and then promote staging to the live theme when it’s right. If a promotion turns out wrong, you can undo it. Nothing you publish to staging reaches shoppers until you promote it.

The workflow

1

Pull the theme

Work in a theme directory bound to the theme you want to change. See CLI.
2

Create staging once

Staging starts as an exact copy of the theme. You only do this once per theme.
3

Publish your changes to staging

Only the files you changed are uploaded. The live theme isn’t touched. Repeat as often as you like.
4

Preview and share

Open the preview link it prints, and send it to anyone who should review the change.
5

Check what promoting would change

It lists every file promoting would write or remove on the live theme. Nothing changes.
6

Promote staging to live

It shows the same list, asks you to confirm, and then puts exactly what staging shows onto the live theme, all at once.
7

Undo if you need to

It puts the live theme back as it was before the promotion.
After a promotion, keep going: publish your next change to staging, preview it, and promote again.

How theme branches work

A branch is a copy of its theme. Creating staging copies the theme: its templates, sections, settings, translations, files, and member sites. The copy belongs to the same company as the theme, and the theme it was copied from is called its parent. Each theme has one branch. A draft or live theme can have one staging branch. It stays until its theme is deleted. A branch is hidden and protected. The staging copy isn’t listed with your other themes and can’t be made live directly. It refuses edits from the theme editor and from a fluid theme push aimed at it. The only way to change it is fluid theme staging publish, so what staging shows is always something someone published to it. Every publish is recorded. After each publish, Fluid records a snapshot of the branch: every file it serves, with a SHA-256 checksum of its content. Publishing, comparing, and promoting all work from these snapshots. A publish lands all at once. A publish applies every changed file in one step. Anyone previewing staging sees the whole previous version or the whole new one, never half of each. Revisions keep publishes in order. Staging starts at revision 0, and each publish raises it by one. A publish is prepared against the revision it started from; if someone else published in the meantime, yours is refused instead of overwriting their work. Staging remembers where it started. Staging also keeps a snapshot of the live theme it was based on: the copy it was created from, and after each promotion, what that promotion left on live. Promotion compares the live theme with this snapshot to make sure nobody changed live in the meantime. The preview is a signed link. Staging is previewed on your real storefront domain through a link that carries a signed token for that one branch. The token can’t be changed to open another theme or another company’s store. A branch goes away with its theme. Deleting a theme also deletes its staging branch, its snapshots, its preview link, and the files it stored. There’s no separate command that removes staging.

CLI commands

Run them from a theme directory you pulled with fluid theme pull. They use the theme this directory is bound to in .fluid-theme.json. Every command also takes: promote and undo-promote also take:

Create staging

1

Request staging

Fluid starts copying the theme in the background. If staging already exists or is already being created, the command reports where it stands instead of failing.
2

Wait until it's ready

The command checks every few seconds and returns when staging is ready or has failed. It gives up after 600 seconds; set another limit with --timeout <seconds>. It exits with code 1 unless staging is ready.
3

Check it

It prints staging’s state and, once it’s ready, its preview link.
If creating staging fails, run fluid theme staging request again. It picks up where the copy stopped.

Publish to staging

The publish sends your local theme files to staging, in three steps:
  1. Declare. The CLI sends the path and SHA-256 checksum of every file, never its content.
  2. Upload. Fluid compares the checksums with staging’s snapshot and asks only for content it doesn’t have. The CLI uploads just those files.
  3. Apply. Fluid applies every changed file in one step, raises the revision, and records a new snapshot.
So a publish where you changed one template uploads and applies one file, and publishing again with nothing changed is quick.
  • Deleting a file locally doesn’t delete it from staging. A publish changes only the files you have.
  • Member sites come along. members_sites.json is published with the rest of the theme, without references to retired account and member pages. Fluid stores the member configuration it imports and may rewrite keys in it, for example a site key becoming the site’s name.
  • If someone else published first, your publish is refused. Publish again; the CLI reads the new revision.
Some files are never published to staging, and the command lists them as skipped: One publish can hold up to 5,000 files, each up to 5 MB of text or 25 MB for images and other binary files.

Compare with staging

Compare tells you whether staging serves exactly the files in your directory. It sends each file’s checksum, never its content, and changes nothing.
When nothing differs, it prints These files match staging (revision 4). members_sites.json is compared by its JSON content, not its exact bytes, because staging stores it in its own layout. Files a publish would skip aren’t compared.

Preview and share staging

fluid theme staging status prints staging’s preview link. It opens staging on your real storefront domain, with a Preview mode banner at the top naming the staging theme.
  • Anyone can open it. The link doesn’t need a Fluid login, so you can send it to a reviewer.
  • It lasts 7 days. Run fluid theme staging status again for a fresh link.
  • The preview stays on while you browse. Following links on the storefront keeps showing staging in that browser until you choose Exit preview in the banner.
  • It stops working once staging is removed. After that, the link shows the live theme.
Cart and checkout in a staging preview act on your real store. Adding to the cart or checking out during a preview uses live data and can create real orders. Share staging links for review, not for test purchases.
Products or pages pinned to a specific template keep using the live theme’s template in a staging preview.

Promote staging to live

Promoting copies exactly what staging serves onto the live theme. You need permission to update themes.
The command shows the same list and asks Promote staging to the live theme?. When you confirm, it prints how many files it wrote and removed. How a promotion works:
  • It writes only what differs. Files where live already matches staging are left alone. A file is removed from live only when it was removed on staging, never because it’s missing from your directory.
  • It lands all at once. Every change is applied in one step, so shoppers see the whole old theme or the whole new one, never a mix.
  • It’s published straight away. Promoted files go live as soon as the promotion finishes.
  • Images and other files are copied. Binary files such as images are copied into files the live theme owns, so deleting staging can never break the live theme.
  • It promotes what you reviewed. The promotion carries the staging snapshot it listed. If someone publishes to staging after you looked, the promotion is refused and you review again.
  • It’s recorded. Fluid records who promoted, when, and every file it changed, with its checksum before and after. That’s what makes undo safe.

When promotion is refused

Promotion only works while the live theme hasn’t changed since staging was created or last promoted. It never merges: rather than overwrite someone’s change to live, it refuses and changes nothing.

Undo a promotion

Undo puts back every file the latest promotion changed, exactly as it was, and removes the files the promotion added. It asks Put the live theme back as it was before the latest promotion? first.
  • Only the latest promotion, once. You can undo staging’s most recent promotion, and only once. Undo it, and you can promote again.
  • Other changes are kept. Changes to live files the promotion didn’t touch stay as they are.
  • Someone’s later edit is never lost. If a file the promotion wrote was changed on live since, undo refuses instead of throwing that change away.
  • Drafts come back. Unpublished drafts that live files had before the promotion are restored. Undo refuses, rather than guess, when a draft can’t be restored exactly, such as a member site draft or a draft of a file that was never published.

Working as a team

Several people can publish to the same staging and promote it. Fluid checks every step, so nobody overwrites someone else’s work by accident. Before you promote, review what promoting would write with promote --dry-run, not only your own files: staging holds everything everyone published to it.

Promote or push?

There are two ways to change the live theme:
  • fluid theme staging promote puts exactly what staging shows onto live. Use it when the change was reviewed on staging, especially when several people publish to it.
  • fluid theme push sends the files in your directory straight to live. In Mist Desktop, Publish does the same.
Promotion only works while every change to the live theme comes through promotion. After the live theme is changed any other way, such as fluid theme push, Publish in Mist, or the theme editor, promoting that staging is refused from then on, because promoting would overwrite that change. Keep going live with fluid theme push after that. For a team that reviews on staging, promote every change rather than mixing promote and push.
When you push instead of promoting, run fluid theme staging compare first. When it says your files match staging, the push sends exactly what you previewed.

Scripts and coding agents

Every staging command takes --json: A promotion has id, branch_id, state (promoted or undone), promoted_at, promoted_by, undone_at, and undone_by. The preview’s state is fast_forward (there’s something to promote), in_sync (live already matches), or parent_changed (live changed, so promotion is refused). promote and undo-promote change the live theme, so with --json they refuse to run without --yes. To promote exactly what a script reviewed, pass the dry run’s snapshot_id:
On failure, a command prints one JSON object with an error holding the refusal’s type and message, and exits with code 1.

Messages you might see

For promotion and undo messages, see When promotion is refused and Undo a promotion.

In Mist Desktop

Mist Desktop runs the same commands for theme projects:
  • Staging tab. Staging shows next to Local and Prod in the preview, with Copy link for a fresh preview link.
  • Publish to staging sits beside Publish.
  • Staging status. Next to the staging pill, Mist shows whether your local files are Up to date with local or have Local changes not on staging. Before Publish sends local files to live, it warns you when they differ from staging.
  • Promote to live shows when staging has something to promote. It lists the files that would change and asks you to confirm. If staging changes while the dialog is open, Mist asks you to review again instead of promoting.
  • Undo promote shows while the latest promotion can be undone.
Promote to live and Undo promote arrive in the Mist Desktop release after 1.5.0. Until you have it, promote and undo with the CLI.