Branch Workflow
๐ Covered in this chapter:
Main/Feature/Release/Hotfix Branches ยท Naming Conventions ยท Branch Cleanup
Understand common branch types โ main, feature, bug-fix, release, and hotfix โ and adopt clear naming conventions.
1Branch Workflow โ What You'll Learn
Understand common branch types โ main, feature, bug-fix, release, and hotfix โ and adopt clear naming conventions.
Here's everything this chapter covers, in the order you'll learn it:
- The main branch as the stable source of truth
- Feature branches for new work
- Bug-fix branches for fixing issues
- Release branches for preparing a version
- Hotfix branches for urgent production fixes
- Consistent branch naming
- Committing safely on a branch
- Switching branches without losing work
- Cleaning up old, merged branches
- Branch protection (overview, covered fully in Phase 11)
2Working Example
๐ป Example: Branch Workflow
Text
feature/java-tutorial
fix/navbar-mobile-layout
docs/update-readme
chore/update-dependencies
3Best Practices & Common Pitfalls
๐ก Key things to remember:
- A consistent prefix system (feature/, fix/, docs/, chore/) makes it instantly clear what kind of work a branch contains, both to humans and to automation.
โ Frequently Asked Questions (FAQ)
Q What's the most important thing to understand about branch workflow?
Focus on: Main/Feature/Release/Hotfix Branches ยท Naming Conventions ยท Branch Cleanup. These are the core building blocks this chapter's examples are built around, and they show up repeatedly in later chapters of this course.
Q Is branch workflow something I'll use often in real projects?
Yes โ every concept in this chapter reflects a real, everyday part of professional Git and GitHub workflows, not just a theoretical exercise.