Git Flow hotfix:
bash
git checkout main
git pull origin main
git checkout -b hotfix/critical-payment-bug
# Fix the bug
git commit -m "fix: resolve payment calculation overflow"
git checkout main && git merge --no-ff hotfix/critical-payment-bug
git tag -a v1.2.1 -m "hotfix: payment bug"
git push origin main --tags
# Backport to develop
git checkout develop && git merge --no-ff hotfix/critical-payment-bug
git branch -d hotfix/critical-payment-bugGitHub Flow hotfix (đơn giản hơn):
bash
git checkout main && git pull
git checkout -b hotfix/payment-bug
# Fix, test
git push origin hotfix/payment-bug
# Tạo PR vào main, mark emergency, get fast review
# Merge → deploy ngayQuan trọng: luôn merge hotfix vào cả production branch VÀ development branch — đừng để fix bị mất ở lần deploy tới.
- Tag version sau hotfix để dễ rollback.
- Viết post-mortem sau khi hệ thống ổn định.