Writing better commit messages

I used to write commit messages like "fix bug" or "update stuff". Now I try to follow this format:

**Subject line** (50 chars or less):
What the change does, in imperative mood.

**Body** (optional, wrapped at 72 chars):
Why the change was made and any relevant context.

Example:
```
Add rate limiting to API endpoints

Without rate limiting, a single client could overwhelm the server.
This adds a sliding window rate limiter using Solid Cache as the
backend, allowing 100 requests per minute per IP address.
```

Your future self will thank you.

Comments (2)

Conventional Commits is worth looking into as well. Prefixing with `feat:`, `fix:`, `docs:` etc. makes changelogs and release notes much easier to generate.

carol_dev

The best advice I got: write the commit message before writing the code. It forces you to think about what you're actually trying to do.