What is Trunk-Based Development and Differences with GitFlow

Okan Davut
2 min readMay 7, 2021

Hi everyone in this article i will try to explain what is the trunk based development. I wrote an articlebefore about What is GitFlow and i will talk about differences between GitFlow and Trunk-based Development in this article.

Trunk based development is a development process based on software developers working on a single main branch.

This development or branching model has created in middle of 1990s. As you can see it’s too much older than GitFlow. Because it’s a traditional way of software development.

Developers are working directly on main branch. Also main branch can be called as ‘master’ or ‘trunk’. This methodology also used by big companies like Google, Facebook.

How it works?

  • All developers works on single branch
  • Main branch often called ‘master’
  • Developers gets latest code from master branch
  • Makes feature development in branch and merge directly to master
  • In some cases developers create short-lived feature branches

You can see scheme of Trunk-based development.

Why Trunk Based Development is Good Choice?

  • Project just started or you need to create POC (proof of concept)
  • Team has more senior developers
  • Need to iterate and act quickly
  • Release Application Changes Consecutively
  • Quicker releases Continuous Integration and Continuous Delivery (CI/CD)
  • Prevents merge conflicts on main branch
  • This methodology also unlocks teams potential and speed

Why Trunk Based Development is Bad Choice?

  • If project is open source
  • If team has more junior developers
  • If have established product or manage large teams.
  • Need to trust team and contributors
  • Hard to review code

Differences between GitFlow and Trunk-based

GitFlow

  • GitFlow manages all with pull requests
  • Controls everything
  • Great for open source
  • Good for large teams and enterprises
  • Big and grown project
  • Good for junior team members

Trunk-based

  • Trust and faith to developers
  • Excellent software development speed
  • Perfect for the new products
  • Need experienced developers
  • Continuous Integration and Continuous Delivery (CI/CD)

Result

As a result, anybody can’t say choose GitFlow or choose Trunk-based. Because both methodologies have different adventages and disadventages. So you need to decide according to your product, team and project.

Thank you for reading. Sharing and applause will increase motivation :).

--

--