AI Assistant Help

AI in VCS integration

AI Assistant integrates with version control systems to help you work more efficiently with your code history. It can generate commit messages, summarize changes, and assist in understanding diffs, making version control tasks easier to manage.

Generate commit messages

AI Assistant can send your diffs to the LLM (Large Language Model), which will generate a commit message describing your changes.

  1. Press Alt+0 to open the Commit tool window.

  2. Click Generate Commit Message with AI Assistant.

    AI Assistant generates commit messages
  3. Edit the message if necessary.

You can also customize the prompt used by AI Assistant to generate commit messages. For example, you can include the branch name in the commit message or instruct AI Assistant to list each change as a separate item.

  1. Click the Gear icon in the bottom-right corner of the Commit tool window.

  2. In the menu, navigate to the AI Assistant section and specify your instructions in the Prompt for generation field.

    Prompt for commit message generation

    Alternatively, you can modify the prompt in the Prompt Library.

Customize the commit message generation prompt

You can customize the prompt used by AI Assistant to generate commit messages by editing it in the Prompt Library.

  1. Press Ctrl+Alt+S to open settings and then select Tools | AI Assistant | Prompt Library.

  2. In the Built-In Actions section, select Commit Message Generation.

    The list of default rules for commit message generation prompt
  3. In the editor field on the right, specify the rules for commit message generation, like the required number of characters or a different language. Use the $GIT_BRANCH_NAME to reference the name of the branch in the commit message.

  4. Click Apply.

Perform Self-Review with AI

Before committing your changes, you can ask AI Assistant to review your updates. This helps highlight any potential issues, allowing you to make improvements immediately or track them for future revisions.

  1. Press Alt+0 to open the Commit tool window.

  2. Select the changes that you want to review before committing.

  3. Click Self-Review with AI. The Problems tool window opens with the AI Self-Review tab selected.

    Self-Review with AI
  4. On the AI Self-Review tab, review the detected issues:

    AI Self-Review tab
    • To navigate to the issue in the editor, either double-click it or select it and press F4.

    • If a quick fix is available for the selected issue, click to apply it.

    • To filter the list of issues, click View Options and choose the desired filtering criteria.

    • To view the selected issue in its source context, click Open Editor Preview. This opens a separate preview pane where you can change the code and apply available quick-fixes.

Just like with uncommitted changes, you can perform a review for the changes that were already committed.

  1. Click in the bottom-left corner (in DataGrip, click the More tool windows icon More tool windows in the header and select Git) or press Alt+9 to open the version control tool window.

  2. In the commits pane, select the commit that you want to review and click Self-Review with AI. AI Assistant will review all files in the commit.

    Self-Review with AI
  3. Review the changes on the AI Self-Review tab.

Define guidelines for Self-Review with AI

You can specify a Markdown file with code review guidelines that will be taken into account by AI Assistant during code review.

  1. Go to Settings | Tools | AI Assistant | Project Settings.

    AI Assistant project settings
  2. Specify the location of the guidelines file in the Path to rules for AI Self-Review setting.

  3. Click Apply to save the changes.

Here is an example of what such guidelines might look like:

# Code Review Guidelines This document outlines guidelines for reviewing code changes, focusing on aspects that might be missed by automated tools. ## Security Vulnerabilities When reviewing code, look for these potential security issues: - **Injection vulnerabilities**: SQL, Command, LDAP, XPath, or other injection flaws - **Authentication issues**: Weak authentication mechanisms, hardcoded credentials - **Authorization problems**: Missing or incorrect permission checks - **Sensitive data exposure**: Unencrypted sensitive data, improper handling of secrets - **Insecure cryptographic implementations**: Weak algorithms, improper key management - **CSRF/XSS vulnerabilities**: Missing CSRF tokens, unescaped user input - **Insecure deserialization**: Deserializing untrusted data without proper validation - **Dependency vulnerabilities**: Outdated libraries with known security issues - **Insecure file operations**: Path traversal vulnerabilities, unsafe file handling - **Race conditions**: Time-of-check to time-of-use (TOCTOU) bugs ## Hard-to-Notice Bugs Pay special attention to these subtle issues: - **Off-by-one errors**: Boundary conditions in loops and array accesses - **Null pointer dereferences**: Missing null checks before accessing objects - **Resource leaks**: Unclosed files, connections, or other resources - **Concurrency issues**: Race conditions, deadlocks, improper synchronization - **Exception handling**: Swallowed exceptions, overly broad catch blocks - **State management**: Incorrect state transitions, missing state validation - **Edge cases**: Handling of empty collections, extreme values, or special inputs - **Floating-point precision issues**: Equality comparisons with floating-point values - **Internationalization bugs**: Locale-dependent operations, character encoding issues - **Logical errors**: Incorrect boolean expressions, misplaced parentheses ## Unintended Code Look for code that was likely not intended to be committed: - **Debug print statements**: Console.log, System.out.println, print, etc. - **Commented-out code**: Large blocks of commented code without explanation - **TODO/FIXME comments**: Especially those indicating incomplete work - **Test or mock data**: Hardcoded test values in production code - **Temporary workarounds**: Code marked as temporary or with "hack" comments - **Gibberish or placeholder text**: Random characters, "asdf", "test123", etc. - **Development configuration**: Local paths, development API keys - **Disabled functionality**: Commented-out method calls or conditionals - **Debugging flags**: Enabled debug modes or verbose logging - **Incomplete refactoring**: Partially renamed variables or methods ## Code Style Issues Review for these code style problems: - **Inconsistent naming conventions**: Mixed camelCase/snake_case, inconsistent prefixes - **Poor code organization**: Overly long methods or classes, poor separation of concerns - **Duplicated code**: Copy-pasted logic that should be refactored - **Magic numbers/strings**: Unexplained literals that should be constants - **Misleading comments**: Comments that don't match the actual code behavior - **Inconsistent formatting**: Mixed indentation, line length violations - **Poor variable names**: Cryptic or overly abbreviated identifiers - **Excessive nesting**: Deeply nested conditionals or loops - **Unused imports/variables**: Dead code that should be removed - **Overly complex expressions**: Code that's difficult to understand at a glance ## Additional Concerns Other issues to watch for: - **Performance problems**: Inefficient algorithms, unnecessary computations - **Maintainability issues**: Code that's difficult to modify or extend - **Accessibility concerns**: UI changes that might affect accessibility - **Backwards compatibility**: Breaking changes to public APIs - **Error handling**: Missing or inappropriate error handling - **Documentation**: Missing or outdated documentation - **Test coverage**: Insufficient test coverage for new or modified code - **Dependency management**: Unnecessary or conflicting dependencies - **Configuration issues**: Hardcoded configuration that should be externalized - **Compliance concerns**: Code that might violate legal or regulatory requirements

Edit and improve commit messages

When you have already committed your changes, you can still edit your commit message. Use AI Assistant to help you analyze and better describe the committed changes.

  1. Click in the bottom-left corner (in DataGrip, click the More tool windows icon More tool windows in the header and select Git) or press Alt+9 to open the version control tool window.

  2. In the commits pane, right-click the commit you want to update and select Edit Commit Message in the context menu.

    Context menu of the selected commit
  3. In the dialog that opens, click Improve Commit Message with AI Assistant.

    Dialog with an old commit message and the AI Assistant icon

    AI Assistant analyzes the committed changes and generates an improved message.

  4. Edit the new message if necessary and click OK to save the changes.

  5. If the commit has already been pushed to the remote repository, press Ctrl+Shift+K to push the updated commit message as well.

Explain commits

AI Assistant can summarize the changes made in one or several commits.

  1. Click in the bottom-left corner or press Alt+9 to open the version control tool window (in DataGrip, click the More tool window icon More tool windows in the header and select Git).

  2. In the commits pane, select the commit or several commits you want to summarize, right-click them and select Explain Commit with AI Assistant in the context menu.

    Explain Commit with AI Assistant option in VCS log

    AI Assistant provides the summary of the selected commits.

    AI Assistant explains commit

Generate title and description for pull and merge requests

AI Assistant can generate titles and descriptions for pull requests and merge requests directly from JetBrains IDEs.

  • When creating a new pull request or a merge request in the corresponding tool window, click Generate a Title and Description with AI Assistant in the description field.

    AI Assistant button in the PR description field

Resolve Git conflicts with AI

When multiple contributors are working with the same part of the codebase, you may encounter overlapping changes that cannot be merged automatically.

JetBrains IDEs have a tool to resolve any such conflicts, and AI Assistant can help you by automatically merging conflicting changes.

  1. In the Merge Revisions dialog, click Merge with AI.

    The Merge with AI option in the Merge Revisions dialog

    AI Assistant then merges both non-conflicting and conflicting changes.

  2. Review the merged result in the central pane of the dialog, edit if necessary, and click Apply.

    Revert changes in the modified lines by clicking Revert.

Generate a summary of an incoming pull request

AI Assistant can generate a summary of an incoming pull request, capturing key details and providing a brief description of the changes. To enable this feature:

  1. Press Ctrl+Alt+S to open settings and then select Tools | AI Assistant.

  2. In the Features section, enable the GitHub Plugin: Generate a summary upon opening a Pull Request setting.

  3. Click Apply.

After that, when you open an incoming pull request, AI Assistant will generate a brief summary.

Generated pull request summary

If the generated summary is not clear enough, click Regenerate to receive an updated version.

You can also fine-tune the summary generation process. To do this:

  1. Hover over the generated summary and click .

    Open settings
  2. Modify the settings as required:

    Configure summary generation
    • Generate automatically on open – enable this setting if you want to automatically generate the summary on opening the pull request.

    • Verbosity – adjust the level of detail in the summary. Higher verbosity includes more information, while lower verbosity keeps it brief and to the point.

    • Formality tone – control how formal or informal the summary sounds.

    • Personality – define the style or character of the summary.

    • Customization prompt – provide specific instructions or preferences to fine-tune the generated summary.

Generate shelf title

When you silently shelve your changes, the new shelf gets the default Changes name. With a lot of shelves, it can become confusing to find the necessary changes.

Instead of manually renaming each shelf, use AI Assistant to automatically generate a title for the silently shelved changelist.

  1. Press Alt+0 to open the Commit tool window.

  2. Select the file or changelist you want to shelve and click Shelve silently Shelve Silently on the toolbar or press Ctrl+Shift+H.

    AI Assistant will automatically generate the shelf name for the shelved changes.

To switch off this feature, press Ctrl+Alt+S to open the settings, go to Tools | AI Assistant, and clear the Generate a title for the shelved changelist checkbox.

24 August 2025
Morty Proxy This is a proxified and sanitized view of the page, visit original site.