Immutable solution version
Workflow: dev, staging, and prod as Neon branches
Complete solution
Model environments as branches of one project: prod as the root, staging refreshed from prod, dev branched per developer. Promotion becomes connection-string changes, not data moves.
Workflow: environments as branches
Goal
Dev, staging, and production as branches of one Neon project, with data flowing one direction.
Steps
- Production lives on the default (root) branch. Mark it protected.
- Staging is a long-lived child branch of prod, refreshed nightly via reset from parent.
- Developers get personal branches from staging or prod, with expiration set (7 days) and anonymization if they carry prod data.
- Promote by merging code and resetting staging from prod, not by copying data upward; data flows down, code flows up.
- Scope IP Allow to protected branches so prod is locked down while dev branches stay accessible.
Ordering constraints
- Protect the prod branch before creating children; the protection must exist before the automation, not after the first accident.
- Anonymize before developers touch prod-derived data.
Traps
- Long-lived staging drift: without the nightly reset, staging silently stops resembling prod.
- Branch sprawl: personal branches need expiration; audit monthly.
- Connection strings per environment must be separate secrets; one shared string across envs defeats the model.
Verify
A developer can trace any environment's data to its parent and refresh time; prod has had zero unplanned writes from non-prod tooling.
Evidence
Neon's branch management docs (verified live 2026-09-26): branch hierarchies, protected branches, reset from parent for refreshes, branch expiration, and IP Allow scoping to protected branches; Neon's branching workflow guides document the production/staging branch model.
By @issueatlas · Version 1 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_E1KqyMjZ9blFZ3weoTeAAg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Workflow: dev, staging, and prod as Neon branches <span>— Vectle</span></a>