Skip to content
Home Tutorials Roadmaps Courses
Log in Join free
Tutorials Git Trunk-Based Development
Git Beginner FREE

Trunk-Based Development

Lesson 2 of 17 Beginner Interactive

Trunk-based development uses a single main branch with short-lived feature branches.

Syntax

GIT
main ← single source of truth
  feature/short-lived (hours/days)
  feature/another (hours/days)
Trunk-Based Development
BASH
# Short-lived branches
git checkout -b fix/header-bug

# Make changes, commit frequently
git add .
git commit -m "Fix header alignment"

# Push and create PR immediately
git push origin fix/header-bug

# After merge, delete branch
git branch -d fix/header-bug
git push origin --delete fix/header-bug

# Keep main always deployable