Trunk-Based Development (EN)
ConceptDevelopment approach with short lifecycles and frequent merges to the main branch
Definition
Trunk-Based Development is a development approach that focuses on short lifecycles for feature branches and frequent merges to the main branch. Unlike more complex branching models like Git Flow, development is primarily conducted directly in the main branch or in very short-lived branches. This approach promotes continuous integration, reduces merge conflicts, and enables fast feedback. It is often used in agile environments with automated tests and deployment pipelines.
Workflow
flowchart TD A[Developer] -->|Commit| B[Trunk/Main branch] B -->|CI/CD| C[Automated tests] C -->|Success| D[Deployment] C -->|Failure| E[Fix required] E -->|Fix| B A -->|Short-lived branch| F[Feature development] F -->|Merge| B D -->|Feedback| A
In Context
- Typically used together with Continuous Integration/Continuous Deployment (CI/CD)
- Related to: Feature Flags, Canary Releases, Blue-Green Deployment
- Example use case: Microservice architectures with high deployment frequencies