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
Stable Diffusion Prompt to Generate a Database Schema
Stable Diffusion, primarily known for artistic image generation, can also be used creatively to produce visual representations of database schemas. By crafting precise prompts, you can generate entity-relationship diagrams, conceptual models, or architectural visualizations of data structures. This approach is particularly useful during brainstorming, technical documentation, or when presenting to non-technical stakeholders. Instead of manually drawing your schemas or using conventional tools like dbdiagram.io, Stable Diffusion allows you to create aesthetically pleasing and professional visual representations of your data models. The resulting outputs can serve as illustrations for documentation, technical blog posts, or training materials. It is important to note that Stable Diffusion generates images and not directly usable SQL code. The goal is therefore to produce clear, readable visuals representing the tables, columns, primary keys, relationships, and cardinalities of your database. With the right settings and a well-structured prompt, you will obtain schemas that are both informative and visually attractive.
Implement input validation
Validate and sanitize inputs
Analyze a JavaScript stack trace
Quickly understand and resolve JavaScript errors
Activation Idea Test
Generating activation experiment ideas