CI/CD Best Practices

Chapter 1 · Practice 1 of 4

Merge small changes into main at least once a day

From Integrating small changes often

Why it matters

DORA's trunk-based development guidance describes teams that merge small, frequent changes into a single main branch rather than living on long feature branches. Its concrete markers are:

PracticeTarget
Active branches in the repositoryThree or fewer
Branch lifetimeA few hours, not days or weeks
Merging to mainAt least once a day
Code freezes and integration phasesNone

Long-lived branches feel safe, but the merge at the end is where conflicts, broken assumptions and surprise regressions pile up. Short branches surface the same problems while they are small.

Unfinished features still merge: hide them behind a feature flag or keep them unreachable until they are ready.

To check, count open branches older than two days and look at how many pull requests are open at once per developer. Both numbers should be small.

Do

  • Split work into changes that can merge within a day
  • Merge unfinished features behind a flag that is off by default

Avoid

  • Feature branches that live for weeks
  • Release branches that collect fixes for a big-bang merge