July 9th, 2025
0 reactions

Customize GitHub Copilot in JetBrains with Custom Instructions

Hang Wang
Program Manager

Today, you can use Custom Instructions in JetBrains to speed up development while staying aligned with your team’s coding standards and personal preferences.

Blog poster250616 Custom Instructions for Copilot in JetBrains image

Whether you’re working on a solo project or part of a larger team, adhering to consistent coding standards is essential. Custom Instructions provide a mechanism to reinforce team coding guidelines or embed personal coding preferences.

Example: Make custom instructions for newly generated code

Make sure you have the latest version of GitHub Copilot installed on you JetBrains IDE. Then, navigate to the GitHub Copilot settings to find the Custom Instructions section.

Go to the Settings page of GitHub Copilot, and find Custom Instructions, in the Copilot Instructions part you can configure custom instructions either for the current workspace or as global settings.

Screenshot 2025 07 10 at 12 09 45 image

Alternatively, you can create the instruction files manually:

  • Workspace-level instructions: .github/copilot-instructions.md (you may find the .github folder in your project root)
  • Global instructions:
    • macOS: /Users/your-username/.config/github-copilot/intellij/global-copilot-instructions.md
    • Windows: C:\Users\your-username\AppData\Local\github-copilot\intellij\global-copilot-instructions.md

In this example, I’m setting a workspace-level instruction.

instruction image

Next, let’s create a new Java class named Quicksort in the root folder, which implements the quicksort algorithm.

coding with rules image

As soon as the class is created, you’ll see the custom header automatically added at the top, just as specified in the Copilot’s custom instructions we configured earlier.

results image

Example: Customize git commit messages

You may also customize the git commit message based on you needs. Go to the Settings page of GitHub Copilot, and find Custom Instructions, then you can configure git commit messages either for the current workspace or as global settings.

Screenshot 2025 07 10 at 12 06 10 image

Alternatively, you can create the instruction files manually:

  • Workspace-level instructions: .github/git-commit-instructions.md (you may find the .github folder in your project root)
  • Global instructions:
    • macOS: /Users/your-username/.config/github-copilot/intellij/global-git-commit-instructions.md
    • Windows: C:\Users\your-username\AppData\Local\github-copilot\intellij\global-git-commit-instructions.md

git instruction image

Now expand the Commit tab in the side bar, and click the Copilot icon logo image, You should see a commit message generated based on the instruction we just set.

place image

Learn More

You can find more custom instructions usage in the official doc.

Feedback

Your feedback drives improvements. Let us know what you think using the in-product feedback option, or share your thoughts in the following channels: JetBrains IDE Feedback.

Category
Java

Author

Hang Wang
Program Manager

I'm Hang Wang, a Product Manager at Microsoft specializing in developer experience. I began my journey at Microsoft as a Software Engineer, gaining deep insights into developers' needs and challenges. Now, I focus on AI-driven tools that enhance developer productivity.

0 comments