Git Flow - Branches as Channels
Git Flow: Branches as Channels is the branch-based deployment strategy alternative to Continuous Version Deployment. Instead of trunk-based deployment, long-lived branches map to release channels with environments tracking specific branches and promotions happening through merges. Uses simple Folder-Based Versioning since branches serve as the versioning mechanism.
Git Flow idiomatically uses Environment Names because branches ARE the environments (channels/dev, channels/staging, channels/prod).
It doesn't make sense to use number-based schemes (SemVer, CalVer) or other label-based schemes (Maturity Levels) with Git Flow—branches carry the version semantics through the merge/promotion flow. The branch name itself indicates which stage a version is in.
Understanding Git Flow
Git Flow is a branching model introduced by Vincent Driessen in 2010 that has become widely adopted in software development. It defines a strict branching structure designed around project releases, using multiple parallel long-lived branches.
Conventional Git Flow Structure
In traditional Git Flow:
- main/master: Production-ready code
- develop: Integration branch for features
- feature/*: Individual feature development
- release/*: Release preparation branches
Changes flow through a defined path:
- Features are developed in feature branches
- Features merge into develop
- Release branches are created from develop
- After testing, releases merge into main and back to develop
Git Flow for Infrastructure
When applied to infrastructure-as-code, Git Flow needs adaptation because:
- Infrastructure has persistent state that doesn't reset between branches
- You can't easily test infrastructure in isolation like application code
- Merge conflicts in infrastructure often have wider implications
- Rollback means reverting infrastructure, not just code
This pattern adapts Git Flow by using branches as deployment channels that environments subscribe to, rather than following the strict feature → develop → release → main flow.
You will learn
- How Git branches can serve as release channels for infrastructure
- Why merge-based promotion provides clear audit trails
- The trade-offs of long-lived branches for infrastructure code
- Strategies for managing branch divergence and merge conflicts
Use Cases
Use the Git Flow: Branches as Channels pattern when:
- Your team is already familiar with Git Flow workflows
- You want centralized promotion control through pull requests
- You need clear audit trails of what was promoted when
- Your organization requires approval gates for promotions
- You prefer merge-based deployment workflows
- You have strong CI/CD integration with Git events
- You want to decouple promotion velocity between environments