Branching Strategies Guide¶
1. Category¶
1.1. Git Flow¶
Git Flow is a lightweight branch-based workflow that separates integration and release activities.
-
Components and Features
-
Base Branches
-
mainProduction-Ready Code
The
mainbranch contains production-ready code only. Direct pushes tomainare forbidden. -
developIntegration Point
The
developbranch is the default integration branch for ongoing development. Direct pushes todevelopare forbidden.
-
-
Support Branches
-
featureIsolated Development
Feature branches are created from
developand merged back intodeveloponly. Branch naming convention:feature/[issue-id]-[short-describe]. -
releasePreparation for Deployment
Release branches are created from
develop(for examplerelease/1.2.x) to prepare production releases and stage final stabilization. -
fixUrgent Production Fixes
Fix branches are created from
main(for examplefix/[issue-id]-[short-describe]) for urgent production issues.
-
-
-
Rules
- Pull requests from
featurebranches targetdeveloponly. - Feature branches never interact directly with
main. - Merge
featurebranches usingSquash and merge. - Merge
releaseandfixbranches first intomain, then back intodevelop. - Merging
releaseintomaincreates a version tag. - Versioning follows Semantic Versioning.
- Commit and pull request titles follow Conventional Commits specification.
- Supporting branches are deleted after merge.
- Pull requests from
1.2. Scaled Trunk-Based Development¶
Scaled Trunk-Based Development uses short-lived feature branches, pull-request reviews, and CI/CD automation before integrating into main.
-
Components and Features
-
Base Branches
-
main(ortrunk)Shared Integration Branch
The
mainbranch is the single long-lived branch. Direct pushes tomainare forbidden.
-
-
Support Branches
-
featureShort-Lived Development Branches
Feature branches are created from
mainand merged back intomainthrough pull requests. Branch naming convention:feature/[issue-id]-[short-describe]. -
releaseRelease Stabilization
Release branches are cut from selected revisions of
main(for examplerelease/1.2.x) when a stabilization stream is required.
-
-
-
Rules
- All integration happens through
main. - Pull requests from
featurebranches targetmainonly. - Merge
featurebranches usingSquash and MergeorRebase and Merge. - Incomplete changes stay behind Feature Flags.
- The
mainbranch should remain backward-compatible and continuously releasable. - Merging into
maincreates release tags and versions. - Versioning follows Semantic Versioning.
- Production fixes are developed on
featurebranches and can be cherry-picked into release branches when needed. - Commit and pull request titles follow Conventional Commits specification.
- Supporting branches are deleted after merge.
- All integration happens through
2. References¶
- Sentenz Branching strategies article.