P
💻DeveloppementIntermediateAll AIs

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

Standardize commit messages in a development teamQuickly write clear commits on an open-source projectSplit a large diff into atomic commits before a pull requestMaintain a clean Git history for automatic changelog generation

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

💻DeveloppementBeginnerChatGPT

Create Your First API with Express.js

Learn to create your first Express.js REST API from A to Z with pedagogical explanations adapted to beginners.

15154
💻DeveloppementIntermediateAll AIs

Generate Precise Regular Expressions with AI

This prompt generates precise and documented regular expressions, tailored to your programming language, with detailed explanations and built-in tests.

063
💻DeveloppementIntermediateClaude

Implement Robust Error Handling in Node.js

Create a professional Node.js error handling architecture with custom error classes, centralized middleware, and monitoring.

33133
💻DeveloppementAdvancedClaude

Design an Application Caching Strategy

Design a complete Redis caching strategy with appropriate patterns, TTL policy, invalidation, and stampede protection.

37183