World map

 

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 git log with the messages fix, asdf, update, stuff and Add README. Terminal output: $ git log --oneline 1ad5b54 (HEAD -> main) fix 40c183b asdf a4bd293 update 43b5fc4 stuff 6d3a9b1 Add README

A month later, you read your log. Which commit added the about page? Nobody knows. Not even you.

Watch

Four vague commits, stuff, update, asdf and fix, turn into four clear ones: Add home page, Add purple style, Add about page, Link about page from home.

A good commit message says what changed. Keep it short: aim for 50 characters or less.

Watch

Added header. becomes Add header. Fixing typos becomes Fix typos.

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.

1 / 8Add contact form
Add contact form

Watch

Three commits get a label in front: feat: add contact form, fix: correct typo on about page, docs: add setup steps to README.

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.

Working folder
Staging area
  • Empty
Repository
  • 3 save points
  • Add purple style
  • Add home page
  • Add README
6d3a9b1e9e6425284495e

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.

A commit with a title and a body. git log -n 1 shows both. Terminal output: $ git add about.html $ git commit -m "feat: add about page" -m "It lists my favourite food." [main 8faee72] feat: add about page 1 file changed, 2 insertions(+) create mode 100644 about.html $ git log -n 1 commit 8faee7295b0ed42b9665bc2e58c4068ef29c7d2e (HEAD -> main) Author: You <you@example.com> Date: Fri Oct 30 09:04:00 2026 +0800 feat: add about page It lists my favourite food.