What a branch gets
The branch’s connection string reaches your code the same way as any credential:
insta postgres url prints it, insta secrets bind wires it into a compute service. After insta branch switch, both target the branch automatically. On self-hosted InstaCloud OSS, secrets bind answers 501: every compute container already receives each service’s credentials under their own names (insta secrets list names them).
Workflows
A development environment with real data. Branch frommain, develop and run migrations against production-shaped data, throw the branch away when you’re done. Nothing you do on the branch can corrupt the parent.
One branch per agent task. Give each coding-agent task its own branch and the agent tests against real data without being anywhere near production. See branch-per-task.
A branch per pull request. Create a branch when a PR opens, run CI against it, delete it on merge, so every PR gets a database with realistic data instead of an empty fixture.
Promote changes to main
There is no promote button, by design: data promotion is a migration, not a copy.- Merge the code branch in git.
- Run your migration files against
main’s database. insta deploy .to ship the code that expects the new schema.- Validate, then
insta branch delete <name>.
insta branch merge <source> --into main handles the structural half: services the source has that the target lacks are created there, empty, so deploy to them afterwards. It never moves data. (On self-hosted InstaCloud OSS, a merged compute group is created and deployed with the source branch’s image against the target’s own database and bucket.)
Limits
- 10 branches per project.
- The parent defaults to your current branch; choose it explicitly with
insta branch create <name> --from <branch>. - Branch names: lowercase letters, digits, and dashes, up to 39 characters, starting with a letter or digit.
insta branch createdoes not switch you.insta branch switch <name>relinks the directory, then reruninsta secretsto refresh.env.
On self-hosted InstaCloud OSS, a branch is a fork on disk: the Postgres data directory and every compute volume are reflink-copied, so
branch create returns in about a second whatever a sleeping database weighs, and the bucket objects are synced. A source that is awake, or a filesystem without reflink support, streams pg_basebackup instead, which is correct but proportional to size. The command-by-command list is in COMPATIBILITY.md.