CodeOath
← All posts
Git65 min total · 17 parts

Git Internals and Workflows: Branching, Merging, and Rebasing

Contents — Part 13 of 17: Common Branching Workflows
Part 13 of 17 · ~1 min

Common Branching Workflows

There's no single correct branching strategy — the right one depends on team size, release cadence, and how much parallel work is normal. Three patterns cover most real projects:

  • Trunk-based development: everyone commits to (or merges very short-lived branches into) a single main branch frequently, often multiple times a day, relying heavily on feature flags to hide unfinished work in production rather than long-lived branches to isolate it. Favors continuous integration and fast feedback; requires strong automated testing and comfort deploying frequently.
  • GitHub Flow: a lightweight model where main is always deployable, every change happens on a short-lived feature branch, and a pull request merges it back after review and passing checks. Simple, widely used for web apps and continuously deployed services, and the closest fit for smaller teams.
  • Git Flow: a heavier model with dedicated long-lived develop and main branches, plus feature/, release/, and hotfix/ branch conventions with specific merge rules between them. Built for projects with scheduled, versioned releases (rather than continuous deployment) where "what's going into version 2.3" needs to be an explicit, stabilized set of changes rather than whatever happens to be on main at deploy time.
WorkflowBest fitTrade-off
Trunk-basedContinuous deployment, strong test/feature-flag cultureRequires discipline to avoid breaking main
GitHub FlowMost web apps, small-to-medium teamsLess structure for coordinating multiple simultaneous releases
Git FlowScheduled/versioned releases, larger teamsMore branches and ceremony to maintain