Skip to main content

What counts as trunk?

Trunk is the main branch of the repository, around which all development is organized in Trunk-Based Development.

Simply put: trunk is the "trunk of the tree", the main line of development.


What is usually considered trunk

Depending on the project and its settings, this can be:

  • main - the most common choice today
  • master - in older repositories
  • trunk - less often, but it does occur (especially in older systems)

The name is not what matters - the role matters more than the name.


Key features of trunk

For a branch to count as trunk, it must:

  1. Be the only main branch
  2. Accept frequent integrations
  3. Always be in a working state
  4. Be the source of releases
  5. Be used by the whole team

What is NOT trunk

  • develop in Gitflow
  • long-lived feature branches
  • release or hotfix branches

These are auxiliary, not central.


Trunk in real practice

In Trunk-Based Development:

  • all changes quickly land in trunk
  • feature branches, if they exist, live very briefly
  • trunk constantly goes through CI
  • trunk can be deployed at any moment

A frequent interview question

Can the develop branch be considered trunk?

No, in the classic understanding of TBD, trunk is a branch that:

  • gets deployed
  • reflects the current state of the product

develop is a Gitflow concept, not a TBD one.


Short answer for an interview

Trunk is the main branch of the repository (usually main or master), around which all development is organized, and into which the whole team's changes are integrated frequently and regularly.

Short Answer

Interview ready
Premium

A concise answer to help you respond confidently on this topic during an interview.