{"id":232317,"date":"2025-07-09T21:20:12","date_gmt":"2025-07-10T04:20:12","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/java\/?p=232317"},"modified":"2025-07-09T21:20:12","modified_gmt":"2025-07-10T04:20:12","slug":"customize-github-copilot-in-jetbrains-with-custom-instructions","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/java\/customize-github-copilot-in-jetbrains-with-custom-instructions\/","title":{"rendered":"Customize GitHub Copilot in JetBrains with Custom Instructions"},"content":{"rendered":"<p>Today, you can use <a href=\"https:\/\/docs.github.com\/en\/copilot\/how-tos\/custom-instructions\/adding-repository-custom-instructions-for-github-copilot?tool=jetbrains\"><strong>Custom Instructions<\/strong><\/a> in JetBrains to speed up development while staying aligned with your team&#8217;s coding standards and personal preferences.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/07\/Blog-poster250616_Custom-Instructions-for-Copilot-in-JetBrains.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-232331\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/07\/Blog-poster250616_Custom-Instructions-for-Copilot-in-JetBrains.png\" alt=\"Blog poster250616 Custom Instructions for Copilot in JetBrains image\" width=\"1200\" height=\"631\" srcset=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/07\/Blog-poster250616_Custom-Instructions-for-Copilot-in-JetBrains.png 1200w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/07\/Blog-poster250616_Custom-Instructions-for-Copilot-in-JetBrains-300x158.png 300w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/07\/Blog-poster250616_Custom-Instructions-for-Copilot-in-JetBrains-1024x538.png 1024w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/07\/Blog-poster250616_Custom-Instructions-for-Copilot-in-JetBrains-768x404.png 768w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/a><\/p>\n<p>Whether you&#8217;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.<\/p>\n<h3><strong>Example: Make custom instructions for newly generated code\n<\/strong><\/h3>\n<p>Make sure you have the latest version of <a href=\"https:\/\/plugins.jetbrains.com\/plugin\/17718-github-copilot\">GitHub Copilot<\/a> installed on you JetBrains IDE. Then, navigate to the <strong>GitHub Copilot settings<\/strong> to find the <strong>Custom Instructions<\/strong> section.<\/p>\n<p>Go to the <strong>Settings<\/strong> page of <strong>GitHub Copilot<\/strong>, and find <strong>Custom Instructions<\/strong>, in the <strong>Copilot Instructions<\/strong> part you can configure custom instructions either for the <strong>current workspace<\/strong> or as <strong>global settings<\/strong>.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/07\/Screenshot-2025-07-10-at-12.09.45.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-232335\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/07\/Screenshot-2025-07-10-at-12.09.45.png\" alt=\"Screenshot 2025 07 10 at 12 09 45 image\" width=\"977\" height=\"284\" srcset=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/07\/Screenshot-2025-07-10-at-12.09.45.png 977w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/07\/Screenshot-2025-07-10-at-12.09.45-300x87.png 300w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/07\/Screenshot-2025-07-10-at-12.09.45-768x223.png 768w\" sizes=\"(max-width: 977px) 100vw, 977px\" \/><\/a><\/p>\n<p>Alternatively, you can create the instruction files manually:<\/p>\n<ul>\n<li><strong>Workspace-level instructions<\/strong>: <code>.github\/copilot-instructions.md<\/code> (you may find the .github folder in your project root)<\/li>\n<li><strong>Global instructions<\/strong>:\n<ul>\n<li><strong>macOS<\/strong>: <code>\/Users\/your-username\/.config\/github-copilot\/intellij\/global-copilot-instructions.md<\/code><\/li>\n<li><strong>Windows<\/strong>: <code>C:\\Users\\your-username\\AppData\\Local\\github-copilot\\intellij\\global-copilot-instructions.md<\/code><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>In this example, I\u2019m setting a <strong>workspace-level instruction<\/strong>.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/07\/instruction.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-232319\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/07\/instruction.png\" alt=\"instruction image\" width=\"972\" height=\"301\" srcset=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/07\/instruction.png 972w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/07\/instruction-300x93.png 300w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/07\/instruction-768x238.png 768w\" sizes=\"(max-width: 972px) 100vw, 972px\" \/><\/a><\/p>\n<p>Next, let\u2019s create a new Java class named <code>Quicksort<\/code> in the root folder, which implements the quicksort algorithm.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/07\/coding_with_rules.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-232320\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/07\/coding_with_rules.png\" alt=\"coding with rules image\" width=\"974\" height=\"278\" srcset=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/07\/coding_with_rules.png 974w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/07\/coding_with_rules-300x86.png 300w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/07\/coding_with_rules-768x219.png 768w\" sizes=\"(max-width: 974px) 100vw, 974px\" \/><\/a><\/p>\n<p>As soon as the class is created, you&#8217;ll see the custom header automatically added at the top, just as specified in the Copilot\u2019s custom instructions we configured earlier.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/07\/results.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-232321\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/07\/results.png\" alt=\"results image\" width=\"975\" height=\"518\" srcset=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/07\/results.png 975w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/07\/results-300x159.png 300w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/07\/results-768x408.png 768w\" sizes=\"(max-width: 975px) 100vw, 975px\" \/><\/a><\/p>\n<h3><strong>Example: Customize git commit messages<\/strong><\/h3>\n<p>You may also customize the git commit message based on you needs. Go to the <strong>Settings<\/strong> page of <strong>GitHub Copilot<\/strong>, and find Custom Instructions, then you can configure git commit messages either for the <strong>current workspace<\/strong> or as <strong>global settings<\/strong>.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/07\/Screenshot-2025-07-10-at-12.06.10.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-232334\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/07\/Screenshot-2025-07-10-at-12.06.10.png\" alt=\"Screenshot 2025 07 10 at 12 06 10 image\" width=\"968\" height=\"287\" srcset=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/07\/Screenshot-2025-07-10-at-12.06.10.png 968w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/07\/Screenshot-2025-07-10-at-12.06.10-300x89.png 300w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/07\/Screenshot-2025-07-10-at-12.06.10-768x228.png 768w\" sizes=\"(max-width: 968px) 100vw, 968px\" \/><\/a><\/p>\n<p>Alternatively, you can create the instruction files manually:<\/p>\n<ul>\n<li><strong>Workspace-level instructions<\/strong>: <code>.github\/<span class=\"s1\">git-commit-instructions<\/span>.md<\/code> (you may find the .github folder in your project root)<\/li>\n<li><strong>Global instructions<\/strong>:\n<ul>\n<li><strong>macOS<\/strong>: <code>\/Users\/your-username\/.config\/github-copilot\/intellij\/global-git-commit-instructions.md <\/code><\/li>\n<li><strong>Windows<\/strong>: <code>C:\\Users\\your-username\\AppData\\Local\\github-copilot\\intellij\\global-git-commit-instructions.md<\/code><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/07\/git-instruction.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-232323\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/07\/git-instruction.png\" alt=\"git instruction image\" width=\"659\" height=\"139\" srcset=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/07\/git-instruction.png 659w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/07\/git-instruction-300x63.png 300w\" sizes=\"(max-width: 659px) 100vw, 659px\" \/><\/a><\/p>\n<p>Now expand the <strong>Commit<\/strong> tab in the side bar, and click the Copilot icon <a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/05\/logo.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-232139\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/05\/logo.png\" alt=\"logo image\" width=\"27\" height=\"29\" \/><\/a>, You should see a commit message generated based on the instruction we just set.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/07\/place.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-232326\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/07\/place.png\" alt=\"place image\" width=\"791\" height=\"264\" srcset=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/07\/place.png 791w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/07\/place-300x100.png 300w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/07\/place-768x256.png 768w\" sizes=\"(max-width: 791px) 100vw, 791px\" \/><\/a><\/p>\n<h3><strong>Learn More<\/strong><\/h3>\n<p>You can find more custom instructions usage in the<a href=\"https:\/\/docs.github.com\/en\/copilot\/customizing-copilot\/adding-repository-custom-instructions-for-github-copilot?tool=jetbrains\"> official doc<\/a>.<\/p>\n<h3><strong>Feedback<\/strong><\/h3>\n<p>Your feedback drives improvements. Let us know what you think using the in-product feedback option, or share your thoughts in the following channels:\u00a0<a href=\"https:\/\/github.com\/microsoft\/copilot-intellij-feedback\/issues\">JetBrains IDE Feedback<\/a>.<\/p>\n<h3><strong> <div  class=\"d-flex justify-content-left\"><a class=\"cta_button_link btn-primary mb-24\" href=\"https:\/\/plugins.jetbrains.com\/plugin\/17718-github-copilot\" target=\"_blank\">Try GItHub Copilot Now<\/a><\/div><\/strong><\/h3>\n","protected":false},"excerpt":{"rendered":"<p>Today, you can use Custom Instructions in JetBrains to speed up development while staying aligned with your team&#8217;s coding standards and personal preferences. Whether you&#8217;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 [&hellip;]<\/p>\n","protected":false},"author":97204,"featured_media":227205,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-232317","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java"],"acf":[],"blog_post_summary":"<p>Today, you can use Custom Instructions in JetBrains to speed up development while staying aligned with your team&#8217;s coding standards and personal preferences. Whether you&#8217;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 [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/posts\/232317","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/users\/97204"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/comments?post=232317"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/posts\/232317\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/media\/227205"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/media?parent=232317"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/categories?post=232317"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/tags?post=232317"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}