Part 2: Branching Strategies and Workflows
Introduction
What Is a Branching Strategy?
Git Flow: The Traditional Approach
Branch Types in Git Flow
Git Flow Workflow
Starting a Feature
Completing a Feature
Creating a Release
Finishing a Release
Handling Hotfixes
Git Flow: Real-World Example
Pros and Cons of Git Flow
GitHub Flow: Simplified for Continuous Deployment
The Simple Rules
GitHub Flow Workflow
Working on a Feature
Creating a Pull Request
Merging and Deploying
GitHub Flow: Real-World Example
Branch Protection Rules on GitHub
Pros and Cons of GitHub Flow
Trunk-Based Development: Modern CI/CD Approach
Core Principles
Trunk-Based Development Workflow
Small, Frequent Changes
Using Feature Flags
Enabling Features Gradually
Trunk-Based Development: Real-World Example
Pros and Cons of Trunk-Based Development
Choosing the Right Strategy
Git Flow
GitHub Flow
Trunk-Based Development
Branch Naming Conventions
My Standard Convention
Naming Best Practices
Working with Pull Requests
My Pull Request Workflow
Handling Merge Conflicts
Practical Tips from Experience
1. Pull Before You Push
2. Push Frequently
3. Commit Often, Push Less Often
4. Rebase to Keep History Clean (Advanced)
Conclusion
PreviousPart 1: Introduction to Version Control and Git FundamentalsNextPart 3: Monorepo vs Polyrepo Strategies
Last updated