Git Branching Strategies (GitFlow/Trunk-based) Cheat Sheet
Comparing common Git branching models — GitFlow, trunk-based development, and GitHub Flow — and when to use each.
2 PagesIntermediateFeb 15, 2026
GitFlow Branch Types
The canonical branch roles defined by the GitFlow model.
- main/master- Always reflects production-ready code; tagged with release versions
- develop- Integration branch where completed features accumulate before a release
- feature/*- Branched from develop, merged back into develop when complete
- release/*- Branched from develop to stabilize a release, merged into main and develop
- hotfix/*- Branched from main to patch production urgently, merged into main and develop
GitFlow Commands
Typical git-flow CLI workflow (via git-flow extension) for a feature.
bash
git flow feature start checkout-redesign# ... work, commit ...git flow feature finish checkout-redesign# merges into develop and deletes the feature branchgit flow release start 1.4.0git flow release finish 1.4.0# merges into main + develop, tags v1.4.0
Trunk-Based Development Workflow
Short-lived branches merged directly into main, gated by feature flags.
bash
git checkout maingit pullgit checkout -b add-search-endpoint# small change, ideally < 1 day of workgit push -u origin add-search-endpoint# open PR, get review, merge same daygit checkout main && git pull && git branch -d add-search-endpoint
When to Use Each Model
Trade-offs between the major branching strategies.
- GitFlow- Good fit for scheduled/versioned releases (e.g. shipped software, mobile apps with app-store review)
- Trunk-based development- Favors continuous delivery; requires strong CI, feature flags, and small PRs
- GitHub Flow- Simplified model: main is always deployable, feature branches merge via PR directly to main
- Release branches- Even trunk-based teams often cut a release branch at deploy time for hotfix isolation
Pro Tip
If your team deploys multiple times a day, GitFlow's long-lived develop/release branches usually add overhead without benefit — trunk-based development with feature flags and small, frequent PRs scales better for continuous delivery.
Was this cheat sheet helpful?
Explore Topics
#GitBranchingStrategiesGitFlowTrunkBased#GitBranchingStrategiesGitFlowTrunkBasedCheatSheet#DevOps#Intermediate#GitFlowBranchTypes#GitFlowCommands#Trunk#Based#Git#CheatSheet#SkillVeris
Advertisement
Sri Hayavadhana Info-Tech
Professional Web Designing Services
- Responsive Websites
- E-commerce Solutions
- SEO Friendly Design
- Fast & Secure
- Support & Maintenance