Search:

Trunk-based Development

What is Trunk Based Development? - kloia Blog

Trunk-based Development is a source-control branching model where there is only a single branch called ‘trunk’ in VCS. Developers collaborate on the ‘trunk’ branch and no long-living development branches. Trunk-based Development model focuses on continuous integration so long-living development branches, which also cause a ‘merge hell’, are avoided.

 

While developers collaborate on the ‘trunk’ branch, they may have short-living branches that live up to 1 day. Branch lifetime has a strong correlation with Agile Methodology adoption and Agile Stories. Small stories make it easier to keep branch lifetimes shorter.

 

Trunk-based Development is a continuous integration friendly branching model and allows teams to detect problems early, especially compared to other VCS branching models with long-living branches.

 

null

Figure 1. Team 1’s branch network, Team 1 follows trunk-based development (left) and Team 2’s branch network, Team 2 has long-living branches (right).

 

As seen in Figure 1., Team 1 has the chance to detect integration problems at t4, t7, t10, t11 and t13 while Team 2 can only detect the integration problem on t13 which is way later than Team 1.

We strongly recommend trunk-based development and following a branching model which doesn’t require long-living branches, such as using feature toggles and branch by abstraction.

 

Mehmet Ali Aydın

DevOps Consultant

Want to work with us?

We embrace a free working culture. You are free to contribute to kloia on the beach with a fresh beverage, in an isolated secret remote treehouse, at the client site, or from a co-working office.

Contact us