Skip to content
~/writing
Process

Git branching and release standard

/ 3 min read / Ejan Shrestha

Version: 1.0 Applies to: All development teams and repositories Environments: DEV, UAT, PROD

1. Branch Structure

We use the following permanent branches:

main
dev
uat
prod

Temporary branches:

feature/*
bugfix/*
release/*
hotfix/*

Branch purpose

BranchPurposeEnvironment
mainStable integration/source-of-truth branch—
devActive developmentDEV
uatUAT-approved release candidateUAT
prodProduction codePROD
feature/*New functionality—
bugfix/*Normal bug fixes—
release/*Release stabilization—
hotfix/*Critical production fixes—

2. Standard Development Flow

feature/*
     ↓
    PR
     ↓
   dev
     ↓
    DEV
     ↓
release/*
     ↓
    UAT
     ↓
   UAT
     ↓
   prod
     ↓
   PROD

Example

feature/payment-integration
        ↓
       PR
        ↓
       dev
        ↓
       DEV
        ↓
release/2.5.0
        ↓
       UAT
        ↓
       prod
        ↓
      PROD

3. Feature Branches

All new development must start from dev.

git checkout dev
git pull origin dev
 
git checkout -b feature/customer-payment

Naming:

feature/customer-payment
feature/google-login
feature/claim-search

Keep feature branches short-lived.

Do not directly commit to dev, uat, or prod.


4. Bug Fixes

Normal bugs:

bugfix/claim-calculation
bugfix/payment-callback
bugfix/report-filter

Create from dev:

dev
 ↓
bugfix/claim-calculation
 ↓
PR
 ↓
dev

5. Release Branch

When the development version is ready for UAT:

dev
 ↓
release/2.5.0

After creating a release branch:

  • No new features

  • Only bug fixes

  • Release/configuration fixes are allowed

  • Changes require PR/review

The release branch is deployed to UAT.

release/2.5.0
       ↓
      UAT

6. UAT → Production

After UAT approval:

release/2.5.0
       ↓
      prod
       ↓
     PROD

Create a Git tag:

v2.5.0

Production must always be traceable to a specific commit/tag.


7. Production Hotfix

For critical production issues:

prod
 ↓
hotfix/payment-failure
 ↓
PR
 ↓
prod
 ↓
PROD

After the hotfix is released, the fix must be merged/back-ported into dev and any active release branch that contains the affected code.

             hotfix
            /   |   \
           ↓    ↓    ↓
         prod  uat   dev

This prevents the production fix from being lost in future releases.


8. Pull Request Rules

Every change must go through a Pull Request.

Minimum requirements:

  • CI/build must pass

  • Tests must pass

  • Code review required

  • No unresolved comments

  • No merge conflicts

  • Branch must be up to date where required

Production branches must be protected.

❌ Direct push → prod
❌ Direct push → uat
❌ Direct push → dev
 
✅ Branch → PR → Review → Merge

9. Environment Rules

DEV

dev → DEV

Automatic deployment is allowed.

UAT

release/* → UAT

Deployment should be controlled and associated with a specific release.

PROD

prod → PROD

Production deployment requires explicit approval.


10. Docker / CI-CD Rule

Build once, deploy the same artifact.

Do not rebuild the application separately for DEV, UAT, and PROD.

Source Code
    ↓
Build
    ↓
Docker Image
    ↓
GHCR
    ↓
DEV
    ↓
UAT
    ↓
PROD

Example:

ghcr.io/company/claim-api:2.5.0

Prefer immutable image tags/digests for production.

Avoid relying on:

:latest

for production deployments.


11. Database Migration Rule

Database migrations must be:

  1. Created and tested in DEV

  2. Tested in UAT

  3. Reviewed before PROD

  4. Executed in a controlled deployment process

Avoid automatically running destructive database migrations during application startup in PROD.


12. Branch Naming Standard

Use lowercase and descriptive names.

feature/customer-login
feature/esewa-payment
 
bugfix/claim-calculation
bugfix/report-filter
 
release/2.5.0
 
hotfix/payment-timeout
hotfix/claim-production-error

Avoid:

test
new-feature
fix
my-branch
ejan-work
temp
final
final2

13. Golden Rules

Every developer should remember these 10 rules:

  1. Never push directly to prod.

  2. Never push directly to uat.

  3. Use a feature/bugfix branch for development.

  4. All changes go through PR and code review.

  5. dev is for active development.

  6. release/* is for UAT stabilization.

  7. uat contains the release being validated.

  8. prod contains production code.

  9. Every production release gets a version tag.

  10. Production/UAT fixes must be back-merged into dev.

One-line workflow

FEATURE → DEV → RELEASE → UAT → PROD

Emergency workflow

PROD → HOTFIX → PROD
             ↓
        back-merge → DEV

This is the standard I would put into your team's engineering documentation.

Ejan Shresthaइजन श्रेष्ठ

Senior Software Engineer, backend and .NET modernisation

Senior software engineer in Kathmandu with 4+ years shipping .NET for insurance and enterprise. I own reliability and modernisation for an insurance platform of 50 .NET projects on Kubernetes: structured logging and tracing across old and new services, the plan off end-of-life .NET to .NET 10, and the fix for socket exhaustion across ~390 call sites.

Selected impact

  • ~390Ending socket exhaustion across the platform. The error class disappeared from production logs, and outbound HTTP now has one place for retries and tracing.
  • 1 IDOne trace from gateway to database. One correlation ID now follows a request end to end.
  • 61%From end-of-life .NET to .NET 10. A sequenced roadmap with known risks; the first services already run on .NET 10.
  • v16A public website on Next.js 16. Shipped to production with a tested rollback path.
  • 4A release standard people follow. Releases are predictable enough to schedule.

Experience

  1. Senior Software Engineer, Himalayan Everest Insurance

    Jan 2025 – present

    Kathmandu, hybrid

    • Own backend reliability and modernisation for an insurance platform of 50 .NET projects, deployed as 28 Kubernetes workloads, across accounting, claims, reinsurance and reporting.
    • Leading the upgrade from .NET Core 2.2, 3.1 and 5 to .NET 10, including the IdentityServer4 replacement.
    • Built structured logging and tracing across every service.
    • Upgraded the public website and CMS to Next.js 16, React 19, Strapi 5 and Node 24.
  2. .NET Developer, EKbana Solutions

    Jul 2022 – Nov 2024

    Lalitpur, on-site

    • Designed backend services for enterprise insurance workflows with ASP.NET Core, PostgreSQL, EF Core and Dapper.
    • Built REST APIs and integrations for customer portals, payments and external partners.
    • Ran background workflows on Hangfire with idempotency, retries and failure recovery.
    • Shipped on Docker, Linux, Nginx/Traefik and Kubernetes; worked on IdentityServer, JWT and RBAC.
  3. Dotnet Developer, NBIT

    Jan 2022 – Jun 2022

    Lalitpur

    • Built and maintained .NET Framework applications for client projects.
  4. Data Specialist, CloudFactory

    Nov 2017 – Jun 2022

    Kathmandu

    • Delivered high-accuracy data work for international clients while completing my degree.