Git Commit Message Prompt

Turn a Git diff into an accurate commit subject, optional body, and compliant footer without inventing tests, issue links, or behavior changes.

Prompt Template

You are a careful software engineer writing a Git commit message from supplied evidence.

Repository convention: [Conventional Commits, imperative subject, ticket prefix, custom guide, unknown]
Staged diff: [paste git diff --cached]
Staged file list: [paste git diff --cached --name-status]
Change intent: [why this change was made]
User-visible behavior: [what changes, or none]
Scope or component: [area of code]
Related issue or ticket: [exact supplied identifier, or none]
Breaking change: [details or none]
Tests actually run and results: [paste, or not run]
Documentation or migration impact: [details or none]
Release-note need: [yes, no, unknown]
Subject length limit: [number, commonly 50-72]
Body line limit: [number, commonly 72]
Words or claims to avoid: [list]
Possible split concern: [does the diff contain more than one logical change?]

Provide:
1. A factual summary of what the staged diff proves.
2. One recommended commit subject following the supplied convention and length limit.
3. An optional body explaining why and noteworthy behavior, wrapped to the requested width.
4. Exact footer lines only for supplied issue, breaking-change, co-author, or signoff data.
5. Two alternative subjects: one plain imperative and one Conventional Commits version.
6. A list of claims omitted because the diff or context does not prove them.
7. A warning if generated files, secrets, unrelated changes, or debugging artifacts appear staged.
8. A recommendation to split the commit when the diff contains separable changes.
9. A test-status line that says not run when no result is supplied.
10. The final commit message in a copy-ready code block with no commentary inside it.

Do not invent an issue number, test result, performance gain, bug cause, user impact, co-author, or breaking change. Base every claim on the staged diff and supplied context.

Example Output

Recommended Message

fix(auth): preserve redirect after session expiry

Store the requested path before redirecting to sign-in, then restore it

after a valid session is created. Ignore external redirect targets.

Tests: not supplied

Plain Alternative

Preserve safe redirects after session expiry

Omitted Claims

- No performance improvement is claimed because no benchmark was supplied.

- No issue footer is included because no identifier was provided.

- No passing-test claim is included because test output was not supplied.

Split Check

The staged files all support one redirect-handling change, so a split is not required.

Tips for Best Results

  • ๐Ÿ’กPaste the staged diff rather than a verbal summary so the message reflects what will actually be committed.
  • ๐Ÿ’กInclude the repository's commit convention and length limits when they differ from common defaults.
  • ๐Ÿ’กSupply exact test output and issue identifiers; the prompt deliberately refuses to invent them.

Frequently Asked Questions

What is the Git Commit Message Prompt prompt?

Turn a Git diff into an accurate commit subject, optional body, and compliant footer without inventing tests, issue links, or behavior changes. It's a free ChatGPT prompt template from our Coding collection โ€” copy it, fill in the bracketed variables, and paste it into your AI tool.

Which AI tools work with this prompt?

It's written and tested for ChatGPT, Claude and Gemini. Any AI assistant that accepts free-form text prompts will handle it well.

How do I customize this ChatGPT prompt?

Replace the bracketed variables โ€” such as [paste git diff --cached], [paste git diff --cached --name-status], [why this change was made] โ€” with your own details before running it. Paste the staged diff rather than a verbal summary so the message reflects what will actually be committed.

Is this prompt free to use?

Yes. Every prompt on PromptAtlas is free to copy, customize, and use โ€” no signup required.