1 Choosing a Branching Strategy
A branching strategy is a team agreement about how branches are named, created, integrated and deleted. There is no single “best” strategy — the right one depends on how often you ship, how big the team is, and whether you support multiple released versions at once.
- GitHub Flow — one long-lived branch (
main), short feature branches, deploy frommain. - GitLab Flow — like GitHub Flow but adds environment or release branches.
- GitFlow — long-lived
developandmain, plusfeature/*,release/*andhotfix/*. - Trunk-based development — everyone commits to one trunk many times a day behind feature flags.
The deeper the integration is delayed, the harder merges become. Strategies that keep branches short-lived reduce painful conflicts.
# List branches and see which one tracks which remote
git branch -vv