Git & GitHub
/Advanced
Trunk Based Development
Definition
A version control management practice where all developers merge small, frequent updates to a core 'trunk' or `main` branch many times a day.
Explain Like I'm New
The extreme version of GitHub flow. Feature branches are barely used. Instead, developers push code directly to `main` constantly. To prevent breaking the app, they hide unfinished features behind 'Feature Flags' (If/Else statements).
Real World Example
Facebook does this. A developer writes half of a new login page, pushes it straight to main, but wraps it in `if (showNewLogin == true)`. Since it evaluates to false, users don't see the broken half-page, but the code is safely integrated.
Common Use Cases
- •Massive engineering teams (Google, Facebook)
- •Avoiding merge conflicts
Interactive Example
Loading...
Console output will appear here...
Interview Questions
basic
- What is the primary benefit of Trunk Based Development?
intermediate
- What is a Feature Flag (or Feature Toggle)?