Skip to content

Summary: Team workflows: GitHub Flow, GitFlow, Trunk-based, Forking

WorkflowLong-lived branchesCeremonyBest fit
GitHub Flow1 (main)LowWeb apps, SaaS, 2-50 engineers, single production
GitFlow2 (main + develop)HighVersioned products (mobile, desktop, embedded, regulated)
Trunk-based1 (trunk)MediumHigh-velocity SaaS, 100+ engineers, mature CI + feature flags
Forking1 (per repo, across N repos)MediumOpen-source, external contributors, restricted-write internal
  1. Default to GitHub Flow unless you have a clear reason not to.
  2. Choose GitFlow only if you ship multiple supported versions.
  3. Migrate to Trunk-based when you have 100+ engineers + mature CI + feature flag infrastructure.
  4. Add Forking on top when you publish an open-source project or accept contributions from people without write access.
  5. Use hybrids almost always: pure workflows are reference points; your team’s needs drive deviations.

Forking is not exclusive with the other three. A solo open-source maintainer typically runs GitHub Flow internally AND uses Forking externally. The first three describe your team’s INTERNAL workflow; Forking describes how OUTSIDERS contribute.

Branch protection rules (the enforcement layer)

Section titled “Branch protection rules (the enforcement layer)”

For long-lived branches:

  • Require PR before merging
  • Require approvals (1 for small teams; 2+ for security-sensitive)
  • Require CI green
  • Require branch up-to-date before merge
  • No force-push
  • No deletions
  • Optionally: require linear history

Typical gates: linting, type checking, unit tests, integration tests, build verification, security scans, optional E2E + performance.

The discipline: every gate has a cost (wait time) and a benefit (caught bugs). Pick gates whose benefit > cost.

  1. Heavy CI: must catch breaks fast
  2. Feature flag infrastructure: to hide incomplete work
  3. Strong code review culture: many direct commits without PR

Without all three, trunk-based breaks the team.

  • GitHub Flow + release tags: day-to-day GitHub Flow; releases tagged on main (covers 80% of versioned-release needs)
  • Trunk-based + light PR: every change goes through PR but PRs live hours, not days
  • GitFlow lite: drop the develop branch; use release/* and hotfix/* only when needed

You now understand the workflow taxonomy. L10 covers release mechanics (tags, semver, release notes). L11 covers cherry-pick + stash. L12 covers rebase deeper.

Git stores snapshots. Every other command is just navigating those snapshots.

A workflow is a convention about which branches exist and how they relate to the production snapshot.