Automate Your Git Commits with AI
This prompt analyzes a Git diff and automatically generates structured commit messages following project conventions, with atomic splitting if needed.
Paste in your AI
Paste this prompt in ChatGPT, Claude or Gemini and customize the variables in brackets.
You are an expert in Git version control and commit conventions (Conventional Commits, Gitmoji). Analyze the following Git diff and generate a structured, professional commit message.
Diff to analyze:
[paste the git diff]
Commit convention used in the project:
[convention: Conventional Commits | Gitmoji | Angular | free-form]
Commit language:
[language: French | English]
For each commit, provide:
- Type: feat, fix, refactor, docs, test, chore, style, perf, ci, build
- Scope (optional): the module or component concerned
- Subject: concise description in the imperative mood (max 72 characters)
- Body (if necessary): detailed explanation of the why, not the what
- Breaking changes: flag any backward-incompatible changes
If the diff contains several distinct logical changes, suggest splitting it into multiple atomic commits ordered chronologically. For each proposed commit, list the files concerned.
End with a ready-to-copy-paste git command for each proposed commit.
Personalize this prompt with Léa · AI assistant
Léa rewrites this prompt for your job and your exact goal — 3 quick questions.
Why this prompt works
This prompt transforms AI into an intelligent versioning assistant. By providing a raw Git diff, you get standardized commit messages that follow Conventional Commits or any other convention used by your team. No more thinking about wording: the AI identifies the change type, scope, and writes a concise subject. One of the key strengths of this prompt is automatic splitting into atomic commits. If your diff mixes a fix, a refactoring, and a new feature, the AI proposes separating these changes into distinct, ordered commits. This considerably improves Git history readability and facilitates targeted reverts. To use it effectively, run git diff --staged before committing, paste the result into the [PASTE_GIT_DIFF] variable, and specify your project convention. You'll get ready-to-use git commit commands that you can execute directly in your terminal.
Use Cases
Expected Output
An ordered list of structured commit messages (type, scope, subject, body) following the chosen convention, accompanied by ready-to-copy git commit commands and the list of files concerned by each commit.
Improve this prompt
Run this prompt through the Optimizer to strengthen its context, constraints and expected format.
Improve this prompt with the OptimizerComments
Be the first to comment on this prompt.
Glossary Terms
📬 Get new prompts every week
Join our newsletter and never miss a prompt.
Go further
Improve this prompt with the Optimizer
Analyze the prompt, strengthen the context and get a more precise version.
Prompt Engineering
Cross-model principles for writing more reliable prompts.
AI prompts for web developers
Code review and debugging, keeping API keys and secrets out of the prompt.
Security, GDPR & Business Plans
ChatGPT Business, Claude Team, Gemini Workspace and Mistral Vibe compared from vendor sources: training, EU hosting and a GDPR checklist.
Similar Prompts
Task brief for Claude Code: frame a feature end to end
Brief template to delegate a complete feature to Claude Code: goal, starting point, constraints, definition of done, working rules and recap format.
Write a project's CLAUDE.md: the brief Claude Code reads at every session
Turns your project description into a dense CLAUDE.md: commands, structure, conventions, pitfalls, off-limits areas and situations where the agent must ask before acting.
Design a Secure Webhook API
Design a webhook API with event subscriptions, signed deliveries, retry limits, and a delivery log your support team can inspect.
Generate Storybook Stories for UI Components
Generate Storybook stories for a UI component, with visual variants, interactive controls, interaction tests, and MDX documentation.