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 : 1. **Type** : feat, fix, refactor, docs, test, chore, style, perf, ci, build 2. **Scope** (optionnel) : le module ou composant concerné 3. **Sujet** : description concise à l'impératif (max 72 caractères) 4. **Corps** (si nécessaire) : explication détaillée du pourquoi, pas du quoi 5. **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é.
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.
Learn more
Check the full skill on Prompt Guide to master this technique from A to Z.
View on Prompt Guide📬 Get new prompts every week
Join our newsletter and never miss a prompt.
Similar Prompts
Set Up Application Observability
Implement the three pillars of observability (logs, metrics, traces) with OpenTelemetry, Prometheus, and Grafana dashboards.
Master Git Reset, Rebase, and Cherry-Pick
Master advanced Git commands (reset, rebase, cherry-pick, stash) with clear diagrams and practical scenarios.
Optimize React Application Performance
Optimize your React application to achieve excellent Core Web Vitals metrics through advanced memoization and code splitting techniques.
Define a Git Strategy for a Team
Define a complete Git strategy adapted to your team: branching model, conventions, code review, and release management.