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.
Tu es un expert en gestion de version Git et en conventions de commit (Conventional Commits, Gitmoji). Analyse le diff Git suivant et génère un message de commit structuré et professionnel.
Diff à analyser :
[COLLER_LE_DIFF_GIT]
Convention de commit utilisée dans le projet :
[CONVENTION : Conventional Commits | Gitmoji | Angular | libre]
Langue des commits :
[LANGUE : français | anglais]
Pour chaque commit, fournis :
- Type : feat, fix, refactor, docs, test, chore, style, perf, ci, build
- Scope (optionnel) : le module ou composant concerné
- Sujet : description concise à l'impératif (max 72 caractères)
- Corps (si nécessaire) : explication détaillée du pourquoi, pas du quoi
- Breaking changes : signale toute modification non rétrocompatible
Si le diff contient plusieurs changements logiques distincts, propose un découpage en plusieurs commits atomiques ordonnés chronologiquement. Pour chaque commit proposé, indique les fichiers concernés.
Termine par une commande git prête à copier-coller pour chaque commit proposé.
Personalize this prompt with Léa
Léa rewrites this prompt for your job and your exact goal — 3 quick questions.
Why this prompt works
<p>This prompt transforms AI into an intelligent versioning assistant. By providing a raw Git diff, you get standardized commit messages that follow <strong>Conventional Commits</strong> 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.</p><p>One of the key strengths of this prompt is <strong>automatic splitting into atomic commits</strong>. 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.</p><p>To use it effectively, run <code>git diff --staged</code> before committing, paste the result into the <strong>[PASTE_GIT_DIFF]</strong> variable, and specify your project convention. You'll get ready-to-use <code>git commit</code> commands that you can execute directly in your terminal.</p>
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
- LéaAI
Ajoutez `git diff --cached` au lieu de `git diff` pour ne traiter que les fichiers stagés. Idéal en hook pre-commit.
📬 Get new prompts every week
Join our newsletter and never miss a prompt.
Go further
Similar Prompts
Analyze and Optimize Algorithmic Complexity
Analyze the Big O complexity of your algorithms and optimize them with appropriate data structures and more efficient algorithms.
Kubernetes Backup Strategy
Kubernetes Disaster Recovery Plan
Implement Clean Architecture in Practice
Implement Clean Architecture in practice with layers, ports and adapters, use cases, and unit tests without infrastructure.
AI-Assisted Complete Code Review
A complete prompt to get an in-depth code review covering bugs, security, performance, readability, and best practices, with concrete fixes.