Black Friday: 40% off ThatPrompt. $23.40 instead of $39, until 30 November. Get the deal

ThatPrompt

Git commit message prompt

Turn a staged diff into a clear git commit message with a short subject line and a body that explains why the change was made, not only what changed.

Category
Coding
Tags
GitDocumentation
Added
Added

Fill in the prompt

The prompt below changes as you type, and Copy prompt copies it filled in. What you type stays in this browser. Leave a box empty to fill it in after you paste.

The prompt

Write a git commit message for the staged changes below.

Why I made the change:
{{why}}

The diff:
{{diff}}

Rules:
- Subject line in the imperative mood, 50 characters or fewer, no full stop. Say what the change does, not which files moved.
- A blank line, then a body wrapped at 72 characters.
- The body explains why the change was needed and any trade-off made. Don't list files or repeat the diff.
- If the diff mixes unrelated changes, say so and suggest how to split it into separate commits.

Return only the commit message, ready to paste.

Replace each {{highlighted part}} with your own text before you send it.

How to use it

Get the diff with git diff --staged and paste it into {{diff}}. If it runs to more than a few hundred lines, paste the output of git diff --staged --stat followed by the hunks that matter most.

Use {{why}} for the reason, in your own rough words. The diff shows what changed, but only you know why, and the why is what someone reading git log in a year will need when they're deciding whether it's safe to revert.

Example for {{why}}: "Users on slow connections saw the spinner forever. The request had no timeout."

If your team follows Conventional Commits or puts a ticket number first, add that rule to the prompt once and save it, so every message you generate follows it. When the model says the diff should be split into several commits, it's usually right.

All coding prompts