What is Trunk-Based Development?
Trunk-Based Development (TBD) is a Git approach where the whole team works around a single main branch (usually main or trunk), and changes land in it very frequently and in small batches.
In simpler terms: "One main branch, frequent commits, minimal long-lived branches."
The main idea of Trunk-Based Development
- there is one central branch -
main/trunk - developers either:
- commit directly into it (with protections),
- or use very short-lived feature branches (hours or 1-2 days)
- code is continuously integrated and tested
No week-long feature branches.
What the work looks like in practice
Option 1: no feature branches at all
- Pick up a task
- Make a small change
- Run the tests
- Commit to
main
Option 2: with short feature branches
- Create a branch from
main - Do a small part of the task
- Open a PR
- Merge into
mainthe same day - Delete the branch
How production is kept from breaking
In Trunk-Based Development, teams almost always use:
- feature flags (feature toggles) - the code is in
mainbut disabled - strict CI
- automated tests
- a ban on large PRs
Code can be in main but unavailable to users.
How it differs from the Feature Branch Workflow
| Feature Branch | Trunk-Based |
|---|---|
| Long feature branches | Short branches or none |
| Large PRs | Small PRs |
| Integration at the end | Continuous integration |
| Conflicts later | Conflicts earlier and simpler |
Advantages of Trunk-Based Development
- Very fast releases
- Fewer merge conflicts
- Continuous integration
- Great fit for CI/CD
Disadvantages
- Requires high discipline
- Needs good tests
- Risky without feature flags
- Harder for beginners
When Trunk-Based Development fits
- frequent releases (several times a day)
- CI/CD
- an actively evolving product
- an experienced team
- delivery speed matters
When it does not fit
- rare releases
- large features without flags
- weak tests
- an inexperienced team
Short answer for an interview
Trunk-Based Development is an approach where development happens around a single main branch, and changes are merged into it frequently and in small batches, which simplifies integration and speeds up releases.
Short Answer
Interview readyPremium
A concise answer to help you respond confidently on this topic during an interview.