holiday-homepage. A new branch starts from the live Site or from another branch. Everyone who can edit the Site shares its branches.
Mist shows a Site’s branches in the Source Control panel. Mist 1.47.0 calls the panel Staging.
Before you start
- Site branches or staging turned on for your company. Fluid turns them on for each company. Site branches turns staging on by itself. Until one is on, Mist doesn’t show Source Control for a Site. To ask for it, contact support.
- Site branches turned on for several branches. With only staging, a Site has one branch, and Mist shows no Live row, New branch or Delete branch.
- Mist 1.49.0 or later. Mist 1.47.0 lets you pick a branch to switch the folder to. Mist 1.49.0 adds the Source Control name, Start from, Promote anyway, Ask Mist to resolve, Delete branch in a branch’s row, Copy live’s data and the database confirmation of an undo. Mist updates itself; restart it to get the latest version. See Download Mist.
- Permission to edit the Site. On a company Site, you make and delete branches as a company admin.
- The Site open in Mist, with its folder on your computer. See Run and publish.
Open the Source Control panel
Open the Site in Mist’s Site editor. In the right rail, click Source Control, the branch icon. The panel has a Branches list on top. Below it, a card for one branch shows its link and the actions below. If the Site has no staging yet, the panel says No staging yet and shows Make staging. With several branches, it also shows New branch. Click Make staging to makestaging.
Make a branch
1
Click New branch
At the bottom of the Branches list, click New branch.
2
Name it
Type a name, such as
holiday-homepage. Use lowercase letters and digits, with single hyphens between them, at most 40 characters. Mist says what’s wrong with a name before it asks Fluid.3
Choose where it starts
Once the Site has a branch, Start from appears under the name. It lists Live site and each branch. It starts on the branch your folder is on, or on Live site when the folder is on the live Site. Mist says what the choice means under the list.
4
Click Make branch
The new branch appears in the list. Its state shows nothing when it’s ready, or Setting up for a moment. When it’s Setting up, click Check again.
main, live, production and master are kept for the live Site. A Site holds a limited number of branches, staging included. When it’s full, Mist shows Fluid’s message, “This site already has 10 branches; delete one first”. Delete a branch you don’t need.
A branch of a Site with a database gets its own database, with the tables of what it started from and no rows. Promoting never moves its rows to the live Site. To start over, or to test with live’s rows, see Reset a branch’s database.
Pick a branch
The Branches list starts with the Live row, the published site, thenstaging, then the other branches. Each branch row shows who made it. A row can show a state:
Click a row to switch the folder to it.
- Mist saves your edits on the branch you leave, so nothing is lost. It says so: “Your edits to … were saved on it.”
- It checks out the one you picked, with what was saved to it since. The card shows Checked out in this folder.
- If the branch needs other packages, Mist installs them. If that fails, Mist says so, and Run shows what the install says.
- If the preview was running, Mist restarts it. Each branch has its own local database, so the preview shows that branch’s rows, and your local rows from one branch never appear on another. See Work with branches.
- If a file changed both here and on the branch, it’s left with conflict markers. Mist asks you to resolve them before you publish.
Publish to a branch and share the link
1
Make your changes
Change the Site in the chat or in your files.
2
Publish to the branch
In the branch’s card, click Publish to and the branch’s name, such as Publish to staging. The live Site doesn’t change.
3
Open the link
In the card, click Open to check the branch, or Copy link to send it to a teammate.
Bring live changes in
When the Site has published since the branch was made or last updated, the card shows a Live changed section with Update from live, and Promote to live is off.1
Click Update from live
Mist merges live’s changes into your folder. Your own changes stay.
2
Resolve any conflicts
A file changed on both sides keeps both versions between
<<<<<<< and >>>>>>> markers. The card lists each file under Resolve conflicts. With several branches, Mist hands the conflicts to the chat, and the strip says it is resolving them. See Let Mist resolve conflicts. You can also fix the markers yourself: each file has an Open button, and How to resolve tells you what to do. Then click Check again. Publish stays off while a file has markers.3
Check the schema
With several branches, once no conflicts are left, Mist asks Fluid whether
db/schema.json plans on the branch’s database and on live’s. Click Check schema if the card asks for it, and read the answer: Schema check passed, Schema problem or Schema not checked. Click Check again after you change the file.4
Publish to the branch
Click Publish to the branch, so its published version holds live.
db/schema.json lists migrations. When two branches add migrations, keep live’s first, in live’s order, then your branch’s own, in your branch’s order. Keep each migration once. If both sides changed one with different steps, give your branch’s migration a new id. See The migration merge rule.
A file one side deleted has no markers. Settle it in the folder: git add keeps it, and git rm removes it.
Let Mist resolve conflicts
With several branches turned on, an Update from live or a switch that leaves conflicts sends them to the Site’s chat. The strip says Mist is resolving the conflicts, keeping both sides’ changes where it can. Nothing is published. Mist keeps both sides’ changes wherever they don’t collide. Where both changed the same thing, it picks the version that fits your change and tells you what it chose and why. It follows thedb/schema.json rule above for that file, and stages each file it fixes.
Mist never publishes, promotes or switches branches while it resolves. Those stay your clicks. The card clears Resolve conflicts once the files are settled.
If the chat can’t take the turn, or Mist stops before it finishes, the strip says Conflicts still need resolving. Click Ask Mist to resolve in the Resolve conflicts card to send it again, or fix the markers yourself. This works with the folder on the live Site or on one of the Site’s branches. A Site with only staging, or a folder on a git branch of your own, keeps the manual steps.
Promote a branch to live
1
Click Promote to live
It’s available once the branch is published and holds what’s live. Mist asks you to confirm and says what’s live now is replaced by the branch’s published version. Click Promote.
2
Confirm a change that deletes data
If the branch’s version drops or renames a table or column, Mist lists it and asks Promote with a change that deletes data? Nothing has been promoted yet. Click Apply and promote to go on.
Promote anyway
Mist checks that the branch holds everything that’s live. It can’t when live’s current version has no saved source. That happens when live was published without its source, such as with--no-source, by a deploy through the MCP server, or before Fluid saved each version’s source. Nothing is promoted, and when Fluid allows it, the card asks Promote without a check against live?
The card says that Fluid can’t check that the branch has everything on live, that promoting replaces live with the branch, and that anything on live that isn’t in the branch will be gone. You can undo the promote. Click Promote anyway to go on, or Cancel to leave live as it is.
- Everything else is still checked. The branch’s own version must have a saved source, the Site’s source can’t be ahead of the branch, and the schema is checked. A destructive change still asks its own question.
- Undo works. The version live had before is the one an undo puts back. See Undo a promote.
- If another version went live meanwhile, Mist asks again about the one that is live now.
Undo a promote
Click the ⋯ menu in the branch’s card, then Undo promote, then Undo to confirm. The version that was live before the promote goes live again, and the branch doesn’t change. Undo promote is in the menu while the promoted version is still live. If another version goes live, Mist doesn’t offer it, so an undo never removes a later change. Fix forward with a new publish instead. If the promote changed the Site’s database, going back may have to change it too. Then Mist stops and asks Roll back the database too? It lists what the database would change, newest first, and what data is lost. Nothing has changed yet. Click Roll back the database to go on, or Cancel. Cancel leaves the Site on the version it served. If the database changed since Mist showed you the steps, Mist says so and shows the new steps. If the database step is unfinished, Mist shows Database step unfinished with Finish the undo. This card is in Mist 1.49.0 and later. An undo is refused when the promote changed the database in a way Fluid can’t reverse. See Undo the database change for what an undo reverses and what data it loses. After an undo, Update from live on the branch you promoted asks Keep this branch’s changes? Click Keep this branch’s changes to keep your files and record the restore as merged, or Take live’s version to take the rolled-back version.Reset a branch’s database
With several branches turned on, the card’s ⋯ menu has Reset database. It gives the branch live’s tables and no rows, and its own rows are lost. When Fluid allows it, Copy live’s data also gives the branch live’s current rows. Mist asks first. The question says people who can edit the Site may see the copied rows, and the branch’s database is unavailable until the copy finishes. Fluid runs it in its next database run, within about 15 minutes plus the copy time. If the copy can’t be made, Mist says Live’s data wasn’t copied, and the branch gets live’s tables with no rows. See Copy live’s rows into a branch for who may do it and the limits.Delete a branch
With several branches turned on, you can delete a branch from the Branches list or from its card.- From the list: click the ⋯ at the end of the branch’s row, then Delete branch….
- From the card: click the ⋯ menu in the card, then Delete branch.
Branches Mist makes
Mist can runfluid sites branch commands in the Site’s folder when you ask it to. After a fluid command runs there, even one that stopped on conflicts, the Branches list reads the Site again. So a branch Mist made shows without a reload.
Troubleshooting
Email Fluid support at help@fluid.app. The Getting help page lists what to include in your request.
Related pages
- Work with branches: the same flow with the command line, for developers
- Theme staging: staging for themes
- Run and publish