Back to lesson

Trunk-Based Development vs Feature Branching

Slide 1: Trunk-Based Development vs Feature Branching

On-screen

Trunk-Based Development vs Feature Branching

Balancing integration and isolation

Narration

Anna: Modern teams debate whether to work directly on the main branch or use long-lived feature branches.
Greg: Each method shapes how quickly changes integrate and how much merge pain you face later.

Slide 2: Trunk-based development

On-screen

Trunk-based development

  • Single shared main line
  • Small, frequent commits
  • Feature toggles for unfinished work
  • Encourages continuous integration

Narration

Anna: Trunk-based development keeps everyone committing to the same main line.
Greg: Small, incremental changes integrate quickly, and feature flags hide work in progress.

Slide 3: Feature branching

On-screen

Feature branching

  • Isolated branches for each feature
  • Merge via pull requests
  • Allows longer-lived work
  • Risk of merge conflicts and drift

Narration

Anna: Feature branching isolates each piece of work so teams can experiment safely.
Greg: The downside is merges grow complex the longer a branch lives away from trunk.

Slide 4: Choosing an approach

On-screen

Choosing an approach

  • Trunk-based boosts flow and feedback
  • Feature branches aid code review
  • Many teams blend both techniques

Narration

Anna: Teams often blend approaches, keeping branches short and integrating daily.
Greg: The goal is fast feedback with just enough isolation for code review and testing.

Slide 5: Key takeaway

On-screen

Key takeaway

Continuous integration thrives on a healthy balance between shared trunk work and short-lived feature branches.

Narration

Anna: Whether you prefer trunk-based or feature branches, keep merges small and frequent.
Greg: Continuous integration works best when nothing stays out of the main line for long.