Video in progress

Junior 🌿 Git

What does a good commit message look like? What is wrong with writing "fix" or "update"?

A good message says what changed and why: a short title (up to 50-70 characters), and if needed, after a blank line, an explanation. Six months later "fix" tells you nothing.

📖 Answer

Commit history is the project's diary. A year from now, when you run git blame and see "fix", "wip", "asdf", nobody can explain why the code was written that way.

Bad:

fix

Good:

Buyurtma bekor qilinganda ombordagi qoldiq qaytariladi

Avval bekor qilingan buyurtma tovari zaxiraga qaytmasdi,
shu sababli sayt "tugadi" deb ko'rsatardi. Endi
OrderCancelledEvent'da StockService.release() chaqiriladi.

Closes #412

The usual rules: the title is in the imperative mood or a short statement of fact, with no period at the end; the body explains the "what" and the "why", while the code itself shows the "how"; adding the task number makes searching easier later. Many teams also use the Conventional Commits format (feat:, fix:).