---
title: "A branch-first dev loop for Neon: link, checkout and env pull"
description: "Neon's CLI adds three commands for branch-first Postgres development. `neon link` binds a workspace to a project and branch via a git-ignored `.neon` file. `neon checkout` creates or switches database branches, much like `git checkout -b`. `neon env pull` writes only the Neon-managed connection strings and service secrets for the current branch into `.env`."
url: "https://swe.quest/articles/a-branch-first-dev-loop-for-neon-link-checkout-and-env-pull-3d4b71e97977636f"
canonical: "https://neon.com/blog/branch-first-dev-loop"
source: "Neon"
published: "2026-06-10"
difficulty: "medium"
kind: "Announcement"
reading_minutes: 6
tags: ["developer-tools","postgres","ai-coding","serverless"]
---

# A branch-first dev loop for Neon: link, checkout and env pull

A post on [Neon](https://swe.quest/sources/neon.md), published 2026-06-10, 6 min read, Announcement. Original: [https://neon.com/blog/branch-first-dev-loop](https://neon.com/blog/branch-first-dev-loop)

## Summary

Neon's CLI adds three commands for branch-first Postgres development. \`neon link\` binds a workspace to a project and branch via a git-ignored \`.neon\` file. \`neon checkout\` creates or switches database branches, much like \`git checkout -b\`. \`neon env pull\` writes only the Neon-managed connection strings and service secrets for the current branch into \`.env\`. Link and checkout run env pull automatically, which suits coding agents that need an isolated database per feature. Teams that keep secrets off disk can pass \`--no-env-pull\` and inject env at runtime with \`@neondatabase/env\` (\`neon-env run\`, \`fetchEnv\`) or export it into varlock.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Developer tools](https://swe.quest/tags/developer-tools.md) (Engineering practices)
- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [AI for coding](https://swe.quest/tags/ai-coding.md) (AI & ML)
- [Serverless](https://swe.quest/tags/serverless.md) (Backend & APIs)

## Prerequisites

- Postgres connection strings ([easy posts on PostgreSQL](https://swe.quest/tags/postgres.md?difficulty=easy))
- git branching workflow
- .env files

## Keywords

Neon, Neon CLI, neon checkout, neon env pull, @neondatabase/env, varlock, AGENTS.md

## Related posts

- [Just landed in the Neon CLI](https://swe.quest/articles/just-landed-in-the-neon-cli-10a12bf3c6b45d1f.md): Neon · 2026-08-25 · Medium · 6 min read · Developer tools, PostgreSQL, AI agents, Schema migrations
  The Neon CLI is renamed from neonctl to neon (old name kept as an alias) and gains a branch-first workflow built on \`neon link\`, \`neon checkout\` and \`neon env pull\`, which store project/branch context in a local .neon file and rewrite only Neon-managed env vars.
- [Automating Neon branch creation with Githooks](https://swe.quest/articles/automating-neon-branch-creation-with-githooks-465e18efc9f92ca6.md): Neon · 2023-05-25 · Medium · 8 min read · Version control, PostgreSQL, Developer productivity
  A Git post-checkout hook can create a Neon database branch for each new Git branch, giving every feature branch an isolated copy of the main Postgres database without a local install or seed scripts.
- [Branching Postgres databases with the Neon API](https://swe.quest/articles/branching-postgres-databases-with-the-neon-api-3faf0de941bc811a.md): Neon · 2022-12-07 · Medium · 3 min read · PostgreSQL, CI/CD, Testing
  Neon branches are copy-on-write clones of a Postgres database that can be created and deleted through the Neon API, giving CI pipelines an isolated copy of production data for end-to-end tests.
- [Fullstack preview environments using Neon and Qovery](https://swe.quest/articles/fullstack-preview-environments-using-neon-and-qovery-5ddb9f5e7c2f931c.md): Neon · 2023-08-11 · Medium · 8 min read · PostgreSQL, CI/CD, Deployment, Serverless
  Each Qovery preview environment can get its own isolated Postgres database by using a Qovery lifecycle job that creates a copy-on-write Neon branch on the environment's Start event and deletes it on Delete.
- [Make Yourself at Home with Neon Local](https://swe.quest/articles/make-yourself-at-home-with-neon-local-be56a855dab1fc15.md): Neon · 2025-04-30 · Medium · 5 min read · PostgreSQL, Containers, Testing, Developer tools
  Neon Local is a Docker-based proxy that exposes a local Postgres endpoint for a Neon cloud database.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
