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

Adapt this prompt

Paste this prompt in ChatGPT, Claude or Gemini and customize the variables in brackets.

You are an expert in Git version control and commit conventions (Conventional Commits, Gitmoji). Analyze the following Git diff and generate a structured, professional commit message.

Diff to analyze:
[paste the git diff]

Commit convention used in the project:
[convention: Conventional Commits | Gitmoji | Angular | free-form]

Commit language:
[language: French | English]

For each commit, provide:

  1. Type: feat, fix, refactor, docs, test, chore, style, perf, ci, build
  2. Scope (optional): the module or component concerned
  3. Subject: concise description in the imperative mood (max 72 characters)
  4. Body (if necessary): detailed explanation of the why, not the what
  5. Breaking changes: flag any backward-incompatible changes

If the diff contains several distinct logical changes, suggest splitting it into multiple atomic commits ordered chronologically. For each proposed commit, list the files concerned.

End with a ready-to-copy-paste git command for each proposed commit.

Personalize this prompt with Léa · AI assistant

Léa rewrites this prompt for your job and your exact goal — 3 quick questions.

Why this prompt works

This prompt transforms AI into an intelligent versioning assistant. By providing a raw Git diff, you get standardized commit messages that follow Conventional Commits 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. One of the key strengths of this prompt is automatic splitting into atomic commits. 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. To use it effectively, run git diff --staged before committing, paste the result into the [PASTE_GIT_DIFF] variable, and specify your project convention. You'll get ready-to-use git commit commands that you can execute directly in your terminal.

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

Be the first to comment on this prompt.

📬 Get new prompts every week

Join our newsletter and never miss a prompt.

Go further

Similar Prompts

💻DeveloppementIntermediateClaude

Task brief for Claude Code: frame a feature end to end

Brief template to delegate a complete feature to Claude Code: goal, starting point, constraints, definition of done, working rules and recap format.

1681
💻DeveloppementIntermediateClaude

Write a project's CLAUDE.md: the brief Claude Code reads at every session

Turns your project description into a dense CLAUDE.md: commands, structure, conventions, pitfalls, off-limits areas and situations where the agent must ask before acting.

640
💻DeveloppementAdvancedAll AIs

Design a Secure Webhook API

Design a webhook API with event subscriptions, signed deliveries, retry limits, and a delivery log your support team can inspect.

411
💻DeveloppementIntermediateAll AIs

Generate Storybook Stories for UI Components

Generate Storybook stories for a UI component, with visual variants, interactive controls, interaction tests, and MDX documentation.

474