Git Branching Model

Team Workflow Visualization

Branch Types

Master
Pre-prod (Mirror)
UAT (Mirror)
Develop
Release
Features
Bugs

Visualized Scenario: The v1.0.2 Release Cycle

1. Development Phase

The team works on develop.
feat/A and feat/B are merged.
bug/X (dev issue) is fixed.
Result: develop is ready for release (12).

2. The Mirror Snap

We cut release/v1.0.2 from develop (13).
Immediate Action: We sync this branch to uat and preprod.
Safe Sync: We use --ff-only (Fast Forward) to ensure we don't overwrite manual changes.

3. QA & Hardening

Bug Y (UAT) and Bug Z (Preprod) are fixed directly on the release branch.
Auto-Sync: Fixes are mirrored to UAT/Preprod and back-merged to develop.

4. Production

QA signs off.
release merges to master (Tag v1.0.2).
master merges back to develop.
• Release branch is deleted.

Standard Branching Strategy

Our workflow follows a "Mirrored GitFlow" methodology. Production candidates are isolated in a release branch, which strictly dictates the state of UAT and Preprod environments.

Branch Role & Alignment
master Production. Stable history. Represents what is currently live. All commits are tagged (e.g., v1.0.2).
develop Integration Hub. Contains current work + future features.
Note: Only merge features intended for the next immediate release.
release/vX.Y.Z Release Candidate. Cut from develop. The Single Source of Truth for UAT and Preprod.
uat & preprod Read-Only Mirrors. These branches are fast-forwarded to match the active release branch.
feat/* Features. Branch from develop → Merge to develop.
bug/* Fixes.
• Dev Phase: Target develop.
• QA Phase: Target release/v* (Triggers Mirror + Sync).

Standard Release Flow

  1. Dev: Merge features/bugs into develop.
  2. Cut: Create release/v1.0.2 from develop.
  3. Mirror: Sync releaseUAT & Preprod (via Fast-Forward).
  4. QA Fix: Fix bug on release.
    • → Sync to UAT/Preprod (for retest).
    • → Sync to develop (for future).
  5. Ship: Merge releasemaster (Tag).
  6. Final Sync: Merge masterdevelop.

Safety Protocols

  • No Force Push: We use git merge --ff-only to update mirrors. This fails safely if UAT has diverged.
  • The Boarding Gate: Do not merge v1.0.3 features into develop until release/v1.0.2 has been cut. Keep them as open Pull Requests.

The Mirror Invariant

release == uat == preprod

We strictly enforce that UAT and Preprod are identical copies of the Release branch. We never merge from UAT to Preprod; we push to both from Release.