BM: Baca dalam Bahasa Melayu
World 1: Save Points
Good commit messages
You will learn: how to write commit messages that still make sense next month.
The problem
A month later, you read your log. Which commit added the about page? Nobody knows. Not even you.
Watch
A good commit message says what changed. Keep it short: aim for 50 characters or less.
Watch
Start with an action word, like an order: Add, Fix, Remove. It should finish the sentence “This commit will…”. Skip the full stop.
Try it
Judge each message. Swipe right if it is good, left if it needs work.
Swipe right for good, left for needs work. Or use the buttons.
Add contact formWatch
Many teams add a label in front. feat: is a new feature. fix: repairs a bug. docs: is for writing. This style is called Conventional Commits.
Check
You fixed a typo on the about page. Pick the best message.
Pick one answer.
Try it
Save about.html with a clean message.
- Empty
- 3 save points
- Add purple style
- Add home page
- Add README
Hint
Used a vague message like “update”? Press “Start again” (↺) and try once more.You did it!
You can now write commit messages that make sense later.
Go deeper (optional)
More labels you will see: style:, refactor:, test: and chore:. Need more detail? Add a second -m for a longer body. Teams pick one language for messages. English is common, but Malay is fine too.
Bahasa Melayu
Sebulan kemudian, anda baca log anda. Commit (titik simpan) mana yang tambah laman about? Tiada siapa tahu. Anda pun tak tahu.
Mesej commit yang bagus sebut apa yang berubah. Pastikan pendek: cuba 50 aksara atau kurang.
Mulakan dengan kata kerja, macam memberi arahan: Add, Fix, Remove. Ia patut melengkapkan ayat “This commit will…”. Tak perlu titik di hujung.
Nilai setiap mesej. Leret ke kanan kalau bagus, ke kiri kalau perlu dibaiki.
Banyak pasukan letak label di depan. feat: untuk ciri baru. fix: baiki pepijat. docs: untuk penulisan. Gaya ini dipanggil Conventional Commits (gaya mesej berlabel).
Anda baiki salah taip di laman about. Pilih mesej terbaik.
Simpan about.html dengan mesej yang kemas.
Kini anda boleh tulis mesej commit yang masih jelas kemudian hari.
You finished this before. Practice is always welcome!
Official docs: git commit (discussion of messages) · Conventional Commits
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?