Prisma Next is in early access.Read the docs

Branching

Branches are isolated environments that map to your Git branches, so preview work never touches production.

A branch is an isolated environment for one line of work. Every branch in a project gets its own apps, databases, and deployments, so work on a preview never touches production.

A platform branch usually matches a Git branch name, but in Prisma it is a real resource that owns its own apps and databases:

How Compute organizes resources and isolates branchesStep 1 of 3
BranchInfrastructureProjectmy-appmaindefault · productionfeature/new-featurepreviewbug/fix-issuepreviewVariables · productionAppDBVariables · previewAppDBVariables · previewAppDB
Your first deploy creates the project, its default production branch, and the infrastructure that runs it: an app, a database, and its production-scoped variables.

Production and preview

Every branch has a role:

  • The first branch in a project is your production branch, usually main. It's protected and durable: after the first deploy, deploys to it need an explicit --prod flag, and automated cleanup never touches it.
  • Every other branch is a preview by default: disposable resources for testing changes before they merge. Preview deploys never ask for confirmation.

To learn more, see the Deployments docs.

How the CLI picks a branch

When you deploy, the CLI resolves the branch in this order:

  1. --branch <name>, if you pass it.
  2. Your active Git branch.
  3. main.

Inside a Git repo, deploying from feature/search targets the feature/search branch automatically. To target a branch explicitly:

bunx @prisma/cli@latest app deploy --branch feature/search

Inspect platform branches:

bunx @prisma/cli@latest branch list

Listing branches doesn't expand the apps and databases inside them. Use the app commands to inspect those.

Creating branches

You rarely create branches manually. They appear when work needs them:

  • On deploy: app deploy --branch feature/search creates the branch if it doesn't exist.
  • From GitHub: when a repo is connected, branch and push events create or update the matching platform branch automatically. To set this up, see the GitHub integration docs.

Connecting GitHub doesn't create branches retroactively; it wires up automation for future events.

Cleaning up

When GitHub is connected, deleting a Git branch tears down the matching platform branch, as long as it isn't your production or default branch. Those are always left alone.

Next steps

On this page