In the pack: ChatGPT, Claude & Gemini Prompts for Coding and Developers
Write a Commit Message From a Diff
Prompt
The staged diff (output of `git diff --staged`): {{DIFF}}
Why I made the change (ticket, bug, motivation): {{WHY}}
Convention to follow, e.g. Conventional Commits, or "plain": {{CONVENTION}}
Rules:
1. Subject line: imperative mood, at most 50 characters where possible and never over 72, no trailing period. Use the type and scope prefix only if my convention calls for it.
2. Blank line, then a body wrapped at 72 characters that explains why the change was needed and what approach was taken. Don't narrate the diff line by line.
3. Mention any behavior change, migration, or breaking change explicitly (with a BREAKING CHANGE footer if using Conventional Commits).
4. Add a footer for the issue reference if I gave one.
5. If the diff contains several unrelated changes, say so and propose how to split it into separate commits, with a message for each.
Give the final message in a code block, ready to paste. Base the "why" only on what I told you; if I gave no reason, write the body around the observable change and add [reason?] where the motivation belongs.
Customize this prompt
Fill in the variables below to personalize this prompt:
Model Settings
Recommended Models
Temperature
Max Tokens
Additional Notes
About this prompt
“Write a Commit Message From a Diff” is a free prompt for ChatGPT in the Coding & Software category, 203 words long, added to The Prompt Index on October 28, 2026 by The Prompt Index. Copy it with the button above, paste it into ChatGPT or any other AI chat assistant, and send it.
It has 3 placeholders to fill in first:
{{DIFF}}, {{WHY}}, {{CONVENTION}}.
Use the “Customize this prompt” fields to personalise it before you copy.
Recommended models: ChatGPT, Claude, Gemini.
0 upvotes, sent to an AI tool 0 times, viewed 3 times.
Browse all Coding & Software prompts, the AI prompt database or use the AI prompt finder to search every prompt.