Banyak developer yang sudah pakai Git tapi belum menerapkan workflow yang benar. Artikel ini membahas Git workflow untuk tim.
Git Flow vs Trunk-Based
Git Flow
- Branch: main, develop, feature/, release/, hotfix/*
- Cocok untuk: Release-based products
- Kelebihan: Structured, clear release process
- Kekurangan: Complex, banyak merge conflicts
Trunk-Based (Recommended)
- Branch: main + short-lived feature branches
- Cocok untuk: SaaS, web apps, CI/CD
- Kelebihan: Simple, fast iteration
- Kekurangan: Butuh CI/CD yang baik
Best Practices
- Commit message yang jelas — Gunakan conventional commits: feat:, fix:, docs:, refactor:
- Branch kecil — 1 PR = 1 fitur/bug fix, bukan mega-PR
- Pull Request review — Minimal 1 reviewer sebelum merge
- Jangan commit ke main langsung — Selalu lewat PR
- Rebase sebelum merge — Keep history clean
Template Commit Message
feat: add user authentication with Google SSO
fix: resolve CORS error on API routes
refactor: extract validation logic to separate module
docs: update API documentation
Terapkan workflow ini dan kolaborasi tim akan jauh lebih smooth.