Merge a branch
Review and merge a branch into main or into another branch: the checks, conflicts, env vars, files, settings and email domains a merge carries, and how to undo one.
A merge moves a branch's changes into another branch, usually main. Floot shows you everything the merge will change, checks the merged code, and either applies all of it or nothing.
Merge into main
- 1
Click Merge
On a branch, Merge takes the Publish button's place in the top bar. It opens the branch's page in Branch Reviews, compared with main. Nothing merges on that click.
- 2
Review the changes
The page lists the files changed (new, edited, removed, and conflicts), the database changes and the migration script, the env vars main doesn't have, and what else the merge will do on main. Ask AI copies a prompt for your assistant to explain the branch or prepare it for the merge.
- 3
Wait for the checks
Floot builds the merged code and tries the migration script before anything changes. If a check fails, the page says what went wrong; Ask AI to fix copies the problem for your assistant. Fix it on the branch, then compare again.
- 4
Merge
The merge saves a checkpoint of main, runs the migration script on main's database, writes the code, then adds the keys and the rest. It ends either merged or failed; a failed merge changes nothing on main.
- 5
Publish main
Your live app stays as it is until you publish main.
The menu beside Merge also has Merge into another branch…, which lets you pick where the changes go, and Publish this branch. In Branch Reviews, Merge branches lets you pick any branch to merge from and any branch to merge into, including main into a branch to bring a long-running branch up to date.
What is checked
- The packages install, the code typechecks, and the backend and frontend build. Type errors that were already on the target before the merge are shown but don't block it.
- The migration script typechecks and runs as a dry run that is rolled back.
- Database matches the merged code: the target's database will have every table, column and enum value the branch's code expects. See Database changes.
- Seed script fits the database, when the project has one.
- Storage files exist for every file the migration script copies.
If one of the branches changes after you compared, the page asks you to compare again before merging.
Conflicts
A conflict is a file both branches changed in different ways, or one deleted while the other changed it. A merge into main never edits main to resolve one: the fix is made on the branch, so the file there holds both sides' changes. The simplest way is to ask your assistant to fix the conflicts (Ask AI to prepare the update copies the prompt), then compare again. Your assistant can also settle a conflict by keeping one side's file whole.
Env vars
Env vars the branch has and the target doesn't are listed with a tick box each. Ticked ones are copied to the target, with the branch's values, when the merge finishes. Unticked ones stay off the target: add them yourself if its code needs them. When both have a key with different values, you choose which value the target keeps.
What else a merge does
What the merged code needs to run travels with it, so you never set a thing up twice. The merge review lists all of it under Also changes on before you merge.
- Images and files
- Every image or file the branch uploaded or generated that the target doesn't have, and every file the merged code uses that the target lacks, is copied. A file the branch replaced under a name the target also has replaces the target's too, unless you untick it under Files replaced on. The target's published app shows a replaced file at once, without a publish, and visitors who saw the old one may keep it for a while.
- App connections
- Connections to your other apps that the branch made are added to the target. A merge only adds connections, never removes one.
- Floot services
- Sign-in, push notifications, payments, shipping and the other services Floot sets up, when the branch added them, are created for the target.
- Settings the code needs
- A few project settings the merged code cannot work without, such as dependency overrides, are set as on the branch, unless the target changed the same setting too. Settings a branch often changes for testing (analytics, page headers, the name, the site description, server memory) are never carried.
- The app icon
- When the branch has a new icon, the review offers Use the branch's app icon: on by default when only the branch changed it.
- Email domains
- If the branch has email domains of its own, you choose: leave them on the branch (they are released when it is deleted), move them to the target next to its own, or replace the target's domains. A merge your assistant starts leaves them on the branch.
Database rows and other stored files are never moved by a merge itself. Only the branch's migration script changes the target's database or moves storage files.
Merging with your AI assistant
Ask your assistant to merge the branch. It compares the branches (compare_branches), fixes any conflicts on the branch, writes the migration script if the database changed, then starts the merge (start_merge) and reports how it ended. Before merging it can send you to the merge review in the editor so you can see the changes yourself.
Into a protected main, the assistant can't merge by itself: it shows a merge card, and the merge starts only when you click Merge on it. The card expires after an hour. Assistants that can't show cards give you a link to the branch in the editor instead.
Undo a merge
Every merge saves a checkpoint of the target before it changes anything. To undo the code of a merge, restore that checkpoint from the Checkpoints panel on main. A restore puts back code and project settings, and the app icon if the merge changed it; it does not undo what the migration script did to the database, and it does not change the published app until you publish. Changes the script made to data can be undone with SQL, or on a paid plan with the database's own restore.
After the merge
A branch merged into main shows Merged · Go to main in the top bar. It stays open, and counts toward your plan's branch limit, until it is deleted: Floot deletes it 7 days after the merge or its last comment, unless you Keep it in Branch Reviews or edit it after the merge. Its code is already in main; its own database copy and comments go with it. A merged branch can't be merged again until it is changed: start new work on a new branch from main.