Kenapa convention penting?
Tanpa standard, tim akan ribut. Dengan standard, semua tau ekspektasi.
Branch naming
Format: tipe/deskripsi-singkat
| Tipe | Untuk |
|---|---|
feature/ | Fitur baru |
fix/ | Bug fix |
chore/ | Cleanup, refactor, dep update |
docs/ | Dokumentasi |
test/ | Tambah test |
experiment/ | Eksperimen — gak otomatis di-merge |
Contoh: feature/login-with-google, fix/calendar-off-by-one, chore/upgrade-react-19
Commit message format (Conventional Commits)
tipe(scope): deskripsi singkat
body opsional kalau perlu jelaskan kenapa.
Footer opsional, mis. "Fixes #123"
Contoh:
feat(auth): add Google OAuth loginfix(calendar): handle DST transition correctlychore(deps): bump next to 16.0.0docs(readme): add development setup section
Code Review (PR/MR)
Sebelum merge:
- Minimal 1 reviewer approve
- Semua CI test pass
- Tidak ada conflict
- Branch up-to-date dengan
main
Reviewer minta perubahan? Push commit ke branch yang sama → PR auto-update.
.gitignore wajib
Minimal:
node_modules/
.env
.env.local
dist/
build/
*.log
.DS_Store
.vscode/settings.json
Tag rilis (Semver)
git tag -a v1.0.0 -m "Release v1.0.0 — initial production"
git push --tags
Versioning: MAJOR.MINOR.PATCH
- MAJOR — breaking change (1.x → 2.0)
- MINOR — fitur baru, backward-compat (1.0 → 1.1)
- PATCH — bug fix (1.1.0 → 1.1.1)
Hook git yang berguna
- pre-commit — auto lint sebelum commit (
prettier --write,eslint --fix) - commit-msg — validate format pesan commit
- pre-push — run test sebelum push
Setup pakai husky (npm package).