Customize GitHub Copilot in JetBrains with Custom Instructions

Try GitHub Copilot Now
Try GitHub Copilot NowToday, you can useCustom Instructions in JetBrains to speed up development while staying aligned with your team’s coding standards and personal preferences.
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 ofGitHub Copilot installed on you JetBrains IDE. Then, navigate to theGitHub Copilot settings to find theCustom Instructions section.
Go to theSettings page ofGitHub Copilot, and findCustom Instructions, in theCopilot Instructions part you can configure custom instructions either for thecurrent workspace or asglobal settings.
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
- macOS:
In this example, I’m setting aworkspace-level instruction.
Next, let’s create a new Java class namedQuicksort
in the root folder, which implements the quicksort algorithm.
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.
Example: Customize git commit messages
You may also customize the git commit message based on you needs. Go to theSettings page ofGitHub Copilot, and find Custom Instructions, then you can configure git commit messages either for thecurrent workspace or asglobal settings.
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
- macOS:
Now expand theCommit tab in the side bar, and click the Copilot icon, You should see a commit message generated based on the instruction we just set.
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.
Author

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.