Skip to content

Branch

Source: src/Neon/Branch.ts

A branch of a Neon project.

Branches are first-class, copy-on-write copies of a parent branch — they share storage with the parent until the new branch starts diverging.

Branching from a project’s default branch

Section titled “Branching from a project’s default branch”
const project = yield* Neon.Project("my-project");
const dev = yield* Neon.Branch("dev-branch", { project });
const dev = yield* Neon.Branch("dev", { project });
const featureBranch = yield* Neon.Branch("feature", {
project,
parentBranch: dev,
});
const branch = yield* Neon.Branch("at-lsn", {
project,
parentLsn: "0/3FA01B0",
});
const featureBranch = yield* Neon.Branch("feature", {
project,
migrationsDir: "./migrations",
});