Git Flow phù hợp khi: release cycle dài (weeks/months), cần maintain nhiều version song song (SaaS với enterprise customers), team lớn cần isolation mạnh. Nhược điểm thực tế: develop branch trở thành "integration hell", feature branches sống lâu gây merge conflict khổng lồ, hotfix phải merge vào cả main và develop.
Trunk-based development (TBD): tất cả developer push thẳng vào main (hoặc branch ngắn <1 ngày). Deploy nhiều lần/ngày.
Dấu hiệu nên chuyển sang TBD: feature branches sống >3 ngày, merge conflict mất >30 phút/tuần, CI pipeline chạy trên develop nhưng main vẫn broken, team muốn CD thực sự.
Migration path: bật feature flags để tách deploy khỏi release, commit nhỏ hơn, CI/CD bắt buộc pass trước merge, pair programming/code review nhanh hơn.
Lưu ý: TBD yêu cầu kỷ luật cao — không có "tôi sẽ fix sau khi merge". Mọi commit vào main phải deploy-ready.
Git Flow works when: release cycles are long (weeks/months), you need to maintain multiple versions simultaneously (SaaS with enterprise clients), or large teams need strong isolation. Real-world downsides: the develop branch becomes an "integration hell", long-lived feature branches cause massive merge conflicts, and hotfixes must be merged into both main and develop.
Trunk-based development (TBD): all developers push directly to main (or branches that live <1 day). Deploy multiple times per day.
Signs you should switch: feature branches live >3 days, merge conflicts take >30 min/week, CI runs on develop but main is still broken, team wants true CD.
Migration path: enable feature flags to decouple deploy from release, make smaller commits, require CI to pass before merge, faster code reviews.
Warning: TBD requires discipline — no "I'll fix it after merge." Every commit to main must be deploy-ready.