You are viewing v1 of 1. Go to the current version · All versions

Write a clear Git commit message

Turn a diff or a rough description into a clean commit message that explains the why, not just the what.

Change note: Initial version

Prompt

Write a Git commit message for this change.

Convention: {{convention}}
Why the change was made (issue, bug report, goal): {{reason}}
Issue or ticket reference: {{ticket}}

Diff or summary of changes:
{{diff}}

Rules:
- Subject line: imperative mood, at most 50 characters, no trailing period, specific enough that someone scanning the log knows what changed.
- Body, wrapped at 72 characters: explain why the change was needed, what approach was taken and any tradeoff or alternative that was rejected. Do not just restate the diff line by line.
- Mention behavior changes, breaking changes or required follow-ups, if any.
- Add the ticket reference in a footer when one is given.
- If the diff contains several unrelated changes, say so and propose how to split it into separate commits with a message for each.

Give me the final message in a code block, then give two alternative subject lines.

Variables

  • {{convention}}Conventionselect

    Options: Conventional Commits, Plain imperative sentence, Gitmoji

    Default: Conventional Commits

  • {{reason}}Whytext

    Default: Users were logged out after password reset because old sessions were not rotated

  • {{ticket}}Tickettext

    Default: AUTH-482

  • {{diff}}Diff or summarylongrequired

    Paste git diff output or describe the change.

Example output

```
fix(auth): rotate session after password reset

After a password reset the existing session id stayed valid, so a
stolen session survived the reset and users on other devices were
not signed out. Issue a new session id on reset and invalidate all
other sessions for the account.

The sessions table gets an index on user_id so the bulk
invalidation stays fast for accounts with many sessions.

Rejected: shortening session lifetime globally, because it would
sign out every user more often for a problem tied to one event.

Refs: AUTH-482
```

**Alternative subjects**
- `fix(auth): invalidate old sessions on password reset`
- `fix(auth): end other sessions after resetting password`

Notes

The rules push the body toward why and tradeoffs, which is what future maintainers need. The split suggestion catches overloaded commits.

Write a clear Git commit message (v1) | LazyPrompt