← Belajar Git

Git untuk Tim — convention yang bikin damai

1 menit baca

Kenapa convention penting?

Tanpa standard, tim akan ribut. Dengan standard, semua tau ekspektasi.

Branch naming

Format: tipe/deskripsi-singkat

TipeUntuk
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:

Code Review (PR/MR)

Sebelum merge:

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

Hook git yang berguna

Setup pakai husky (npm package).