DevOps Engineer interview question · Most asked

Trunk-based development or GitFlow: which do you prefer, and why?

Summary

Trunk-based development (short-lived branches merged to main at least daily, kept releasable, with unfinished work behind feature flags) supports continuous delivery and is associated with higher delivery performance in DORA's research. GitFlow (long-lived develop and release branches) suits scheduled releases of versioned software but creates merge pain and slows feedback.

Longer Answer

Trunk-based development requires strong automated testing, fast CI, feature flags or branch-by-abstraction for incomplete work, and code review that keeps up (small pull requests). GitFlow can still fit products that ship versioned releases to customers who upgrade on their own schedule (mobile apps, on-premise software), though even there many teams use trunk-based development with release branches cut from main.

Key Points

  • Trunk-based: small, frequent merges to main.
  • Associated with higher delivery performance.
  • Needs fast CI and feature flags.
  • GitFlow for versioned, scheduled releases.

More most-asked DevOps Engineer questions

← All DevOps Engineer questions