Trunk-based development
In short: In trunk-based development all developers work on one shared main branch and merge only very short-lived branches, often within a day.
In more detail: The opposite is long feature branches that drift apart for days and end in painful merges.
In Depth
- Rules: Small changes, integrate often, the main branch always works.
- Feature flags: Unfinished features ship behind a switch, turned off. This separates deployment from release.
- Prerequisites: Fast automated tests, continuous integration and code review that does not take days.
- Advantages: Fewer merge conflicts, faster feedback, simpler releases.
- Disadvantages: Demands discipline and good test coverage. Big rebuilds must be split into small steps (“branch by abstraction”).
- Contrast: GitFlow with
develop, release and hotfix branches is more laborious and suits software with fixed versions.
See also: git rebase