
Editorial illustration: a feature-based branching workflow for separating development, testing and production release decisions.
Most small engineering teams do not actually have a deployment problem. They have a code-mixing problem.
Everyone pushes to one shared dev or staging branch because it feels fast. Then release day arrives, and you discover that Alice’s search filter is ready to ship, Ben’s checkout redesign is half-finished, and Chen’s payment gateway upgrade is still waiting on sandbox credentials. Now the team is stuck choosing between shipping broken work or holding back features the client already approved.
The fix is not a heavy seven-branch GitFlow ceremony. It is making sure every branch answers one clear question: what is being built, what is being tested, or what is going live?
Give each branch one clear job
You only need a few branch roles, each with a clear contract:
mainis production. Lock it down with branch protection so nobody pushes directly to it—every change arrives via a reviewed pull request.- Feature branches (
feature/*,fix/*,chore/*) hold one isolated task, created from the latestmain. devis where selected feature branches are merged together for early integration testing. Merging intodevdoes not mean “ready for production.”stagingis the client-facing or UAT environment for realistic acceptance checks.- A dated deployment branch (such as
deployment_20261022) is your release candidate—a clean assembly of only the features approved for this release window.
The exact names matter less than team agreement. If one developer treats staging as “anything I want to preview” while the project lead treats it as “tomorrow’s release,” the workflow breaks down no matter what you name the branches.
Branch from production and keep the scope tight
Always start a new task from a fresh local copy of main unless you explicitly depend on another unreleased change:
git switch main
git pull --ff-only origin main
git switch -c feature/search-filters
Starting from main keeps your diff focused on your actual task instead of dragging in a week of unrelated commits from dev. Keep the branch narrow: include the code, tests, and database migrations for that task, and resist the urge to refactor three unrelated files along the way.
Before opening a pull request, run your local sanity checks:
git status
npm test
npm run build
A green local build does not replace CI, but it saves your teammates from reviewing obvious syntax or lint errors.
Treat pull requests as promotion gates
When the feature is ready for integration testing, push it and open a pull request into dev:
git push -u origin feature/search-filters
Write a brief PR note explaining the problem, what changed, how you tested it, and any migration or environment variable requirements. Crucially, a PR into dev means “let’s test this alongside other active work,” not “ship this to users.”
Once it passes integration checks in dev, promote the feature to staging through a pull request or a clean, documented merge. Avoid quietly copying commits between branches by hand—if someone asks why a bug appeared on staging, the Git history should show exactly how it got there.
Assemble a dated deployment branch for release day
When you are ready to cut a release, start fresh from main and create a dated deployment branch:
git switch main
git pull --ff-only origin main
git switch -c deployment_20261022
Now merge only the feature branches that passed staging and received sign-off. If feature/search-filters and feature/export-csv are approved while feature/new-checkout is still waiting on QA, only the first two enter deployment_20261022.
This is where the workflow pays off. Everyone—developers, QA, and stakeholders—can inspect one concrete branch (git diff main..deployment_20261022), deploy it to a production-like staging slot, and run final regression and migration checks. If a small bug pops up during release testing, fix it on the feature branch (or a small release-fix branch) and merge that fix into the deployment branch—never patch files directly on the server.
After final sign-off, open the release pull request from deployment_20261022 into main, merge it, deploy, and tag the commit (git tag -a v2026.10.22 -m "Release Oct 22").
Sign-off, hotfixes, and traps to avoid
A few habits keep this workflow from collapsing under pressure:
- Make sign-off specific. “Looks good” is weak; “Tested invoice PDF export and FPX callback on staging with test merchant account” tells the release manager what was actually verified.
- Plan for urgent hotfixes. If production breaks at 10 PM, branch
hotfix/*directly frommain, test and merge it back intomain, and immediately mergemainback intodevandstagingso the next release does not reintroduce the bug. - Kill long-lived feature branches. A branch sitting open for six weeks will drown in merge conflicts. Break large features into smaller increments or hide incomplete UI behind a feature flag.
- Avoid routine
git cherry-pickas a release strategy. Cherry-picking creates duplicate commit hashes with different histories, making it much harder later to verify whether a fix is actually inmain.
For related guides that complement this checklist, see:
- Git Merge Conflict? Use a Temporary Branch to Resolve It Safely
- Your Website Is Broken in the Browser: A Practical DevTools Guide to Finding the Real Cause
- Your Website Works for You—But Can Everyone Use It? A Practical Accessibility Checklist
You do not need complex Git tooling to make releases predictable. Start features from main, test them through dev and staging, and assemble only approved work into a dated deployment branch so production never inherits someone else’s half-finished code.