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é.

Personalize this prompt with Léa

Answer 3 questions and Léa tailors the prompt to your situation.

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.

Improve this prompt

Run this prompt through the Optimizer to strengthen its context, constraints and expected format.

Improve this prompt with the Optimizer

Comments

  • 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

💻DeveloppementIntermediateAll AIs

Integration Testing for REST APIs

Test API endpoints under real-world conditions

0104
💻DeveloppementIntermediateAll AIs

Implement secrets management

Secure credentials management

099
💻DeveloppementAdvancedAll AIs

Design an event-driven system

Architect event-driven systems

0110
💻DeveloppementAdvancedAll AIs

Design a Versioned API

Evolving a public API without breaking integrations

098