Writing precise Git commit messages and pull request descriptions is essential for healthy software repositories, but manually drafting them for every branch context switch drains developer focus. JetBrains AI Assistant integrates directly into the IDE version control workflows—specifically IntelliJ IDEA, WebStorm, PyCharm, GoLand, and related IDEs—allowing engineers to generate context-aware commit messages, conduct AI-driven self-reviews, and draft comprehensive PR descriptions without leaving the editor.
This guide walks through setting up and using JetBrains AI Assistant to automate commit summaries and pull request documentation, configure prompt templates to match team standards, and leverage companion version control features like merge conflict resolution and code review assistance.
Prerequisites and Setup
Before generating commit messages or pull request overviews, verify that your IDE environment meets the following conditions:
- Compatible JetBrains IDE: Version 2024.1 or newer (such as IntelliJ IDEA, PyCharm, WebStorm, GoLand, Rider, or CLion).
- AI Assistant Plugin & Subscription:
- The JetBrains AI Assistant plugin must be installed and enabled under Settings | Plugins (
Ctrl+Alt+Son Windows/Linux,Cmd+,on macOS). - You must be logged into your JetBrains Account with an active subscription (AI Free trial quota, AI Pro, AI Ultimate, or organizational access through JetBrains Central).
- The JetBrains AI Assistant plugin must be installed and enabled under Settings | Plugins (
- Version Control Integration:
- A local repository initialized with Git or Mercurial.
- The bundled Git and GitHub (or GitLab) plugins enabled to access the Pull Requests tool window.
1. Generating Commit Messages with AI Assistant
JetBrains AI Assistant examines the diff of staged files or selected changelists to draft descriptive commit messages that highlight both the "what" and the "why" of your changes.
Step-by-Step Execution
- Open the Commit Tool Window:
- Press
Alt+0on Windows/Linux orCmd+0on macOS (or useCtrl+K/Cmd+K).
- Press
- Select Modified Changes:
- Check the boxes next to the modified files, specific code chunks, or changelists you want to include. AI Assistant only generates descriptions for selected changes, making partial commits clean and targeted.
- Trigger AI Generation:
- Click the Generate Commit Message with AI Assistant icon (the AI sparkle/wand symbol) located at the top-right of the commit message input box.
- Review and Polish:
- AI Assistant analyses the diffs and inserts a concise subject line followed by bullet points detailing key modifications.
- Review the text to ensure project-specific issue keys (e.g.,
PROJ-1234) or breaking changes are captured accurately before committing (Ctrl+EnterorCmd+Enter).
Add JWT authentication middleware and token expiration check
- Introduce AuthTokenValidator class to verify bearer tokens
- Register authentication interceptor in security configuration
- Add unit test coverage for expired and malformed tokens
2. Customizing Commit Message Formats and Team Guidelines
Different development teams follow specific commit conventions, such as Conventional Commits (feat:, fix:, refactor:), strict character limits on the subject line, or mandatory branch and ticket references. JetBrains provides two ways to customize AI generation prompts:
Method A: Quick Prompt in the Commit Tool Window
- Click the Gear icon in the bottom-right corner of the Commit tool window.
- Under the AI Assistant section, enter formatting directives into the Prompt for generation field.
- Use the built-in variable
$GIT_BRANCH_NAMEto automatically insert branch identifiers into the message (for instance:Prefix every commit message with the issue ID extracted from $GIT_BRANCH_NAME).
Method B: Global Rules via Prompt Library
- Navigate to Settings | Tools | AI Assistant | Prompt Library (
Ctrl+Alt+SorCmd+,). - Under Built-In Actions, select Commit Message Generation.
- Edit the system prompt rules in the right-hand editor pane:
- Enforce commit conventions: "Always use Conventional Commits syntax (
feat:,fix:,docs:,chore:)." - Set length boundaries: "Keep the summary line under 50 characters, and wrap description lines at 72 characters."
- Language preferences: Specify English or local project languages.
- Enforce commit conventions: "Always use Conventional Commits syntax (
- Click Apply. All future generations will follow these rules.
3. Pre-Commit AI Self-Review
To avoid pushing unintended debug code, syntax slips, or security issues, JetBrains AI Assistant includes an automated self-review capability directly inside the Commit window.
- In the Commit tool window (
Alt+0/Cmd+0), select the changes you intend to check in. - Click Self-Review with AI.
- The IDE opens the Problems tool window under the AI Self-Review tab, flagging potential concerns:
- Forgotten debugging statements (e.g., leftover
console.logorprint). - Null pointer risks, unhandled edge cases, and resource leak possibilities.
- Code style and naming inconsistencies.
- Forgotten debugging statements (e.g., leftover
- Double-click any flagged issue or press
F4to jump to source code, apply quick-fixes, and ensure your code is clean before committing. - You can also define custom Markdown rules (e.g., security checklists and company style guides) under Settings | Tools | AI Assistant | Project Settings in the Path to rules for AI Self-Review field.
4. Editing and Improving Existing Commits
If you have already committed changes locally but need to improve the commit log prior to pushing:
- Open the Git log window by pressing
Alt+9on Windows/Linux orCmd+9on macOS. - In the commits pane, right-click the desired commit and choose Edit Commit Message.
- Click Improve Commit Message with AI Assistant.
- The AI re-evaluates the historical diff and generates a refined summary. Click OK to save, and push your updated branch (
Ctrl+Shift+KorCmd+Shift+K).
5. Generating Pull Request and Merge Request Descriptions
When moving from local branch commits to team code review, writing a comprehensive Pull Request (PR) or Merge Request (MR) description ensures reviewers understand the context and testing steps quickly.
Generating PR Content from JetBrains IDEs
- Open the Pull Requests Tool Window:
- Select Git | GitHub | View Pull Requests (or GitLab | View Merge Requests) from the main menu.
- Start a New Pull Request:
- Click the
+icon to initiate a new PR/MR, selecting the base and head branches.
- Click the
- Generate Title and Body:
- In the PR description editor, click Generate a Title and Description with AI Assistant.
- The assistant aggregates the branch's commits and structural code changes across all modified files.
- It outputs an informative PR title alongside a structured Markdown body, typically organizing changes into:
- Summary: High-level problem solved or feature delivered.
- Key Changes: Bulleted breakdown of affected modules.
- Verification: Suggested test scenarios covered.
- Refine and Publish:
- Add deployment notes, linked issue IDs, or reviewer tags as needed, then click Create Pull Request.
Summarizing Incoming Pull Requests
When reviewing PRs opened by colleagues, AI Assistant can also generate incoming summaries automatically:
- Enable this under Settings | Tools | AI Assistant | Features -> GitHub Plugin: Generate a summary upon opening a Pull Request.
- Adjust parameters including Verbosity (brief vs. detailed), Formality tone, and Personality, or add a custom guidance prompt.
Best Practices and Workflow Recommendations
| Recommendation | Why It Matters |
|---|---|
| Commit frequently with partial staging | Providing AI Assistant with smaller, cohesive diffs produces pinpoint commit summaries rather than vague, sprawling messages. |
| Verify issue tracking IDs | Automated generation analyzes code semantics but cannot guess external sprint ticket IDs unless configured via $GIT_BRANCH_NAME. |
| Combine with Git Hooks & Commit Checks | Use native IDE commit checks (Reformat code, Optimize imports, Analyze code) alongside AI generation for pristine repository hygiene. |
| Leverage "Merge with AI" during conflicts | When rebasing or merging upstream branches, open the Merge Revisions dialog and click Merge with AI to resolve conflicting blocks intelligently. |
By incorporating JetBrains AI Assistant into your daily Git and GitHub/GitLab cycles, you eliminate the mental friction of drafting release logs while ensuring your project history remains clean, standardized, and immediately understandable for the entire team.
References
- AI in version control | AI Assistant Documentation
- Create and Understand Commit Messages with AI Assistant - JetBrains Guide
- Commit and push changes to Git repository | IntelliJ IDEA Documentation
- Review incoming GitHub pull requests | IntelliJ IDEA Documentation
- AI Assistant in JetBrains IDEs - The JetBrains Blog