A merge a day: long-lived branches and feature flags

January 21, 2025 · 3 min read

I wrote this in reply to a post by Ákos Kőműves, “A merge a day keeps broken software away.” His point: a build pipeline, automated tests and feature branches aren't enough for real continuous integration. Developers should merge into the mainline at least once a day. I couldn't agree more.

Long-lived branches are a headache

They lead to endless merge conflicts and unnecessary rework. Conflicts are bad enough, but when a branch carries big architectural changes or a major refactor, it gets worse. Everyone working off main suddenly has to rework parts of their code to fit. The bigger the team, the bigger the mess, and most of it could have been avoided.

The part that gets overlooked is feedback. When you work in isolation on a branch, your team doesn't see your changes until it's finally merged. By then, any feedback comes too late, and acting on it is painful and slow.

Merging small, incremental changes into main at least once a day fixes this. Things keep moving, feedback comes early, and integration stops being an event.

But what if you release all the time?

A common question from teams with continuous delivery: should we push incomplete features into main? And if not, where do they live until they're done?

Feature flags. You hide the unfinished feature behind a toggle and switch it on when it's ready, so main stays clean and always releasable. As engineers, building software that is always in a releasable state is a skill worth learning. Flags should be used sparingly, though. Most of the time you can design the code so that inactive features are simply harmless.

It's a culture, not a pipeline

It's no surprise that many teams are moving away from long-lived feature branches towards trunk-based development. Merging often avoids integration headaches, gets you faster feedback and keeps the team productive.

At its core, CI isn't about tools or pipelines. It's about a culture where progress is shared often and people build on each other's work. That's when it really works.

First posted on LinkedIn.