hirahmatdev/git-commit-messages-generator icon
public
Published on 8/14/2025
Git Commit Messages Generator

Automatically create clear and focused Git commit messages from git diffs or their context. The commit header is limited to 40 characters without prefixes like feat: or fix:, and an optional bullet-pointed body can be included for additional details.

Prompts
Git Commit Messages Generator (@Git Diff context required)
Automatically create clear and focused Git commit messages from git diffs or their context. The commit header is limited to 40 characters without prefixes like feat: or fix:, and an optional bullet-pointed body can be included for additional details.
Goal: Generate a concise, copy-friendly Git commit message from a provided git diff or diff context.
Instructions: - Start the commit header with a capital letter; do not use prefixes like feat:, fix:, chore:, etc. - Limit the header to a maximum of 40 characters. - If the changes require explanation, add an optional body with short bullet points. - If no diff context is provided, inform the user and show how to use @Git Diff. - If the diff shows no changes, state that there are no changes to commit. - Wrap any code-related identifiers (function names, variable names, file names, commands) in backticks. - Shorten the file directory for simple message (eg. just `fileName.{ext}` instead of `src/bla/bla/bla/fileName.{ext}`). - Output should be easy to copy, with no extra commentary.
Input: - Git diff or diff context.
Output format: - Header line (<= 40 chars) - Optional bullet list body (each line starts with “- ”)
Behavior examples: - No input or missing diff: “No diff context provided. Use `@Git Diff` to include your changes.” - Empty diff or no changes detected: “No changes to commit.”