Preview and feature development
Create an isolated environment for a pull request or feature branch.
Neon · Command
Creates a Neon branch for isolated development or testing. It defaults to the project's default branch and a read-write compute, with options for naming, parenting, expiration, protection, and compute sizing.
Run this command to create a Neon branch for isolated development or testing. Supply the project ID, optionally choose a branch name and parent, and use compute-related options to control whether and how a compute endpoint is created.
neon branches create [options]| Name | Type | Description |
|---|---|---|
--compute | boolean | Whether to create a compute; defaults to true, and --no-compute disables it. |
--cu | string | Compute Units as a fixed value or range, such as 2 or 0.5-3. |
--expires-at | string | Expiration date for the branch. |
--name | string | Name assigned to the branch. |
--parent | string | Parent branch name, ID, timestamp, or LSN. |
--protected | boolean | Whether the branch is protected. |
--project-id | string | Project in which to create the branch. |
A newly created Neon branch; the documentation also states that branches create commands return a connection string.
--project-id.--name to assign a human-readable branch name; if omitted, the command defaults to the branch ID.--parent accepts a branch name, branch ID, timestamp, or LSN as the branch source.--parent is not supplied, the new branch is based on the project's default branch.--cu configures compute capacity using a fixed number or a hyphen-delimited range.--expires-at lets you assign an expiration timestamp to the branch instead of leaving it without an expiration.neon branches create --name pr-1234 --project-id <project-id>Creates a named branch in the specified project, using the project's default branch as the parent unless another parent is supplied.
Create an isolated environment for a pull request or feature branch.
Make a disposable copy of a development or staging branch.
Create a branch without an immediately provisioned compute.
Automatically retire temporary branches after a specified date.
neon branches create do, and which identifier is required?The command is neon branches create [options]. It creates a branch in a Neon project, and the project ID identifies where the branch is created. The branch name is optional; without one, the default is the branch ID.
Follow-up: How would you create a branch without a compute endpoint? Use --no-compute, which overrides the default read-write compute behavior.
Use --parent to choose the source branch. The option accepts a parent branch name, branch ID, timestamp, or LSN; if omitted, creation uses the project's default branch.
Follow-up: Why might a timestamp or LSN be useful? It allows the new branch to represent a point-in-time state rather than only the current parent state.
The command creates a read-write compute by default. --cu sets the Compute Units as either a fixed value such as 2 or a range such as 0.5-3, while --no-compute creates the branch without compute.
Follow-up: What other creation-time compute choice is exposed? --compute controls whether a compute is created, with true as its default.
neon branches listneon branches deleteneon branches resetneon connection-string