The workflow
1
Pull the theme
2
Create staging once
3
Publish your changes to staging
4
Preview and share
5
Check what promoting would change
6
Promote staging to live
7
Undo if you need to
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 afluid 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
2
Wait until it's ready
--timeout <seconds>. It exits with code 1 unless staging is ready.3
Check it
fluid theme staging request again. It picks up where the copy stopped.
Publish to staging
- Declare. The CLI sends the path and SHA-256 checksum of every file, never its content.
- Upload. Fluid compares the checksums with staging’s snapshot and asks only for content it doesn’t have. The CLI uploads just those files.
- Apply. Fluid applies every changed file in one step, raises the revision, and records a new snapshot.
- Deleting a file locally doesn’t delete it from staging. A publish changes only the files you have.
- Member sites come along.
members_sites.jsonis 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.
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
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 statusagain 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.
Promote staging to live
Promoting copies exactly what staging serves onto the live theme. You need permission to update themes.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
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 promoteputs exactly what staging shows onto live. Use it when the change was reviewed on staging, especially when several people publish to it.fluid theme pushsends the files in your directory straight to live. In Mist Desktop, Publish does the same.
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:
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.