Git branching strategies (Git Flow, GitHub Flow)?
1. Git Flow
Complex, for scheduled releases.
``` main (production) develop (integration) feature/* (new features) release/* (release prep) hotfix/* (urgent fixes) ```
Pros: Structured, clear roles Cons: Complex, slow
2. GitHub Flow
Simple, for continuous deployment.
``` main (always deployable) feature/* (short-lived) ```
Workflow:
- Create feature branch
- Commit changes
- Open Pull Request
- Review & merge
- Deploy main
Pros: Simple, fast Cons: Requires good CI/CD
3. Trunk-Based Development
Very short-lived branches.
```bash
git checkout -b feature/quick-fix
git checkout main git merge feature/quick-fix ```
Pros: Continuous integration Cons: Requires discipline
Short Answer
Interview readyPremium
A concise answer to help you respond confidently on this topic during an interview.