Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

Neon · Const

Default branch

Neon’s default branch is the project’s designated branch for default workflows and implicit branch creation. It starts as the root branch, but you can move the designation to another existing branch.

How it works

A Neon project always has one branch marked as its default. You can assign that role to another existing branch; Neon removes the designation from the former default. The default branch is also the source used when creating a branch without explicitly choosing a parent.

Syntax

neon branches set-default <id|name>

Parameters

NameTypeDescription
id|namestringBranch ID or name to designate as the project default.

Returns

The selected branch becomes the project's default branch, and the prior default designation is removed.

Key points

  • Every Neon project has exactly one branch carrying the default designation.
  • The designation can be moved to any existing branch in the project.
  • Branch creation uses the default branch as the parent when no parent is supplied.
  • The Console marks the current default with a DEFAULT label.
  • Changing the default automatically clears the designation from the former default.

Example: Change the default branch

neon branches set-default staging

Sets the existing staging branch as the project's default branch.

When to use it

Change the project default

Make a staging or release branch the project’s default for subsequent workflows.

Use implicit branch ancestry

Create a branch without specifying a parent and have it derive from the project default.

Find the active default

Identify the branch selected by default in the Neon Console.

Interview questions

QWhat is Neon’s default branch?

A default branch is the project branch carrying Neon’s default designation. It is selected automatically in relevant Console workflows, and a branch created without an explicit parent is based on it.

Follow-up: How do you change it? Use the CLI neon branches set-default <id|name> or the API endpoint that sets a specified branch as default; the previous designation is removed.

QWhich branch is initially the default?

The initial branch is the project’s root branch, which is also designated as the default. Console-created projects name it production, while API- or CLI-created projects name it main.

Follow-up: Can the root branch be removed? No. The root branch cannot be deleted, regardless of whether its name is production or main.

QCan the default designation be moved?

Any existing branch can become the project’s default branch. In the Console it is identified with a DEFAULT tag, and changing the designation automatically removes it from the former default.

Follow-up: What operational behavior follows the designation? New branches with no specified parent derive from whichever branch currently has the designation.

  • root branch
  • branch
  • neon branches set-default
  • setDefaultProjectBranch

Source: Manage branches - Neon Docs. Checked 2026-10-16.