Git Branching Strategies Cheat Sheet

Choose models (GitHub flow, GitLab flow, trunk-based) and keep merges predictable Quick reference guide with examples and best practices. Updated November 2025.

Last Updated: November 21, 2025

Model Comparison

Model Characteristics
GitHub flow Main + feature branches, deploy from main
GitLab flow Environment branches + release tracking
Trunk-based Short-lived feature toggles, commit to trunk daily

Common Commands

git checkout -b feature/xyz
Start new branch
git fetch && git rebase origin/main
Stay current
git merge --no-ff feature/xyz
Preserve history

Policy Tips

Require CI checks, squash merges when needed, and document release branching rules.

💡 Pro Tip: Short-lived branches + enforced PR reviews reduce merge headaches.
← Back to DevOps & Cloud | Browse all categories | View all cheat sheets