Suggest an editImprove this articleRefine the answer for “What is Trunk-Based Development?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)**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 in small batches. **Key point:** one main branch, frequent commits, minimal long-lived branches, often paired with feature flags.Shown above the full answer for quick recall.Answer (EN)Image**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 1. Pick up a task 2. Make a small change 3. Run the tests 4. Commit to `main` --- ### Option 2: with short feature branches 1. Create a branch from `main` 2. Do a small part of the task 3. Open a PR 4. Merge into `main` the same day 5. 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 `main` but 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.**For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.