Skip to content

Commit b576d66

Browse files
authored
Merge pull request #39230 from github/repo-sync
Repo sync
2 parents 7244aec + 3debeec commit b576d66

File tree

5 files changed

+233
-16
lines changed

5 files changed

+233
-16
lines changed

content/copilot/concepts/about-customizing-github-copilot-chat-responses.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@ redirect_from:
2828
2929
{% endvisualstudio %}
3030

31+
{% jetbrains %}
32+
33+
> [!NOTE] This version of this article is about custom instructions in JetBrains IDEs. Click the tabs above for other environments. <!-- markdownlint-disable-line MD027 -->
34+
{% endjetbrains %}
35+
36+
{% xcode %}
37+
38+
> [!NOTE] This version of this article is about custom instructions in Xcode. Click the tabs above for other environments. <!-- markdownlint-disable-line MD027 -->
39+
{% endxcode %}
40+
3141
## About customizing {% data variables.copilot.copilot_chat %} responses
3242

3343
{% webui %}
@@ -61,6 +71,18 @@ While custom instructions help to add codebase-wide context to each AI workflow,
6171

6272
{% endvisualstudio %}
6373

74+
{% jetbrains %}
75+
76+
{% data variables.product.prodname_copilot %} can provide chat responses that are tailored to the way your team works, the tools you use, or the specifics of your project, if you provide it with enough context to do so. Instead of repeatedly adding this contextual detail to your chat questions, you can create a custom instructions file in your repository that automatically adds this information for you. The additional information is not displayed in the chat, but is available to {% data variables.product.prodname_copilot_short %} to allow it to generate higher quality responses.
77+
78+
{% endjetbrains %}
79+
80+
{% xcode %}
81+
82+
{% data variables.product.prodname_copilot %} can provide chat responses that are tailored to the way your team works, the tools you use, or the specifics of your project, if you provide it with enough context to do so. Instead of repeatedly adding this contextual detail to your chat questions, you can create a custom instructions file in your repository that automatically adds this information for you. The additional information is not displayed in the chat, but is available to {% data variables.product.prodname_copilot_short %} to allow it to generate higher quality responses.
83+
84+
{% endxcode %}
85+
6486
{% webui %}
6587

6688
## Using custom instructions
@@ -169,6 +191,42 @@ Common use cases include:
169191

170192
{% endvisualstudio %}
171193

194+
{% jetbrains %}
195+
196+
## About repository custom instructions
197+
198+
Repository custom instructions consist of a single file, `.github/copilot-instructions.md`, that you create in a repository. The instructions you add to the file should be short, self-contained statements that add context or relevant information to supplement chat questions.
199+
200+
Common use cases include:
201+
202+
* **Test generation.** Create instructions for test generation, such as specifying the use of a certain test framework.
203+
* **Code review.** Specify instructions for reviewing code, such as telling a reviewer to look for a specific error in the code.
204+
* **Commit message generation.** Write instructions for generating commit messages, such as format or the type of information to include.
205+
206+
### Example
207+
208+
{% data reusables.copilot.repository-custom-instructions-example %}
209+
210+
{% endjetbrains %}
211+
212+
{% xcode %}
213+
214+
## About repository custom instructions
215+
216+
Repository custom instructions consist of a single file, `.github/copilot-instructions.md`, that you create in a repository. The instructions you add to the file should be short, self-contained statements that add context or relevant information to supplement chat questions.
217+
218+
Common use cases include:
219+
220+
* **Test generation.** Create instructions for test generation, such as specifying the use of a certain test framework.
221+
* **Code review.** Specify instructions for reviewing code, such as telling a reviewer to look for a specific error in the code.
222+
* **Commit message generation.** Write instructions for generating commit messages, such as format or the type of information to include.
223+
224+
### Example
225+
226+
{% data reusables.copilot.repository-custom-instructions-example %}
227+
228+
{% endxcode %}
229+
172230
## Next steps
173231

174232
{% webui %}
@@ -190,3 +248,9 @@ Common use cases include:
190248
* [AUTOTITLE](/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot)
191249

192250
{% endvisualstudio %}
251+
252+
{% jetbrains %}
253+
254+
* [AUTOTITLE](/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot)
255+
256+
{% endjetbrains %}

content/copilot/how-tos/chat/asking-github-copilot-questions-in-your-ide.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ You can ask {% data variables.copilot.copilot_chat_short %} to give you code sug
372372

373373
The response often includes interactive elements. For example, the response may include buttons to copy or insert a code block.
374374

375-
To see the files that {% data variables.copilot.copilot_chat_short %} used to generate the response, select the **References** dropdown below the response.
375+
To see the files that {% data variables.copilot.copilot_chat_short %} used to generate the response, click the **References** link below the response. The references may include a link to a custom instructions file for your repository. This file contains additional information that is automatically added to all of your chat questions to improve the quality of the responses. For more information, see [AUTOTITLE](/copilot/how-tos/custom-instructions/adding-repository-custom-instructions-for-github-copilot).
376376

377377
## Using keywords in your prompt
378378

@@ -488,6 +488,8 @@ You can ask {% data variables.copilot.copilot_chat_short %} to give you code sug
488488

489489
The response often includes interactive elements. For example, the response may include buttons to copy or insert a code block.
490490

491+
To see the files that {% data variables.copilot.copilot_chat_short %} used to generate the response, click the **References** link below the response. The references may include a link to a custom instructions file for your repository. This file contains additional information that is automatically added to all of your chat questions to improve the quality of the responses. For more information, see [AUTOTITLE](/copilot/how-tos/custom-instructions/adding-repository-custom-instructions-for-github-copilot).
492+
491493
## AI models for {% data variables.copilot.copilot_chat_short %}
492494

493495
{% data reusables.copilot.change-the-ai-model %}

content/copilot/how-tos/custom-instructions/adding-repository-custom-instructions-for-github-copilot.md

Lines changed: 151 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,42 @@ This version of this article is for using repository custom instructions in {% d
116116

117117
{% endvisualstudio %}
118118

119+
{% jetbrains %}
120+
121+
> [!NOTE] This feature is currently in {% data variables.release-phases.public_preview %} and is subject to change.
122+
123+
This version of this article is for using repository custom instructions in JetBrains IDEs. Click the tabs above for instructions on using custom instructions in other environments.
124+
125+
## About repository custom instructions for {% data variables.copilot.copilot_chat %}
126+
127+
Repository custom instructions are currently supported for {% data variables.copilot.copilot_chat_short %} in JetBrains IDEs, {% data variables.product.prodname_vs %}, {% data variables.product.prodname_vscode_shortname %}, Xcode, and on the {% data variables.product.github %} website.
128+
129+
{% data variables.product.prodname_copilot %} can provide chat responses that are tailored to the way your team works, the tools you use, or the specifics of your project, if you provide it with enough context to do so. Instead of repeatedly adding this contextual detail to your chat questions, you can create a file in your repository that automatically adds this information for you. The additional information is not displayed in the chat, but is available to {% data variables.product.prodname_copilot_short %} to allow it to generate higher quality responses.
130+
131+
### Example
132+
133+
{% data reusables.copilot.repository-custom-instructions-example %}
134+
135+
{% endjetbrains %}
136+
137+
{% xcode %}
138+
139+
> [!NOTE] This feature is currently in {% data variables.release-phases.public_preview %} and is subject to change.
140+
141+
This version of this article is for using repository custom instructions in Xcode. Click the tabs above for instructions on using custom instructions in other environments.
142+
143+
## About repository custom instructions for {% data variables.copilot.copilot_chat %}
144+
145+
Repository custom instructions are currently supported for {% data variables.copilot.copilot_chat_short %} in Xcode, {% data variables.product.prodname_vs %}, {% data variables.product.prodname_vscode_shortname %} JetBrains IDEs, and on the {% data variables.product.github %} website.
146+
147+
{% data variables.product.prodname_copilot %} can provide chat responses that are tailored to the way your team works, the tools you use, or the specifics of your project, if you provide it with enough context to do so. Instead of repeatedly adding this contextual detail to your chat questions, you can create a file in your repository that automatically adds this information for you. The additional information is not displayed in the chat, but is available to {% data variables.product.prodname_copilot_short %} to allow it to generate higher quality responses.
148+
149+
### Example
150+
151+
{% data reusables.copilot.repository-custom-instructions-example %}
152+
153+
{% endxcode %}
154+
119155
## Prerequisites for repository custom instructions
120156

121157
* You must have a custom instructions file (see the instructions below).
@@ -140,17 +176,110 @@ This version of this article is for using repository custom instructions in {% d
140176

141177
{% endvisualstudio %}
142178

179+
{% jetbrains %}
180+
181+
* The latest version of the {% data variables.product.prodname_copilot_short %} extension must be installed in your JetBrains IDE.
182+
183+
{% endjetbrains %}
184+
185+
{% xcode %}
186+
187+
* The latest version of the {% data variables.product.prodname_copilot_short %} extension must be installed in Xcode.
188+
189+
{% endxcode %}
190+
143191
## Creating a repository custom instructions file
144192

193+
{% jetbrains %}
194+
195+
You can create a custom instructions file in your repository using the {% data variables.product.prodname_copilot_short %} settings page, or you can create the file manually.
196+
197+
Whitespace between instructions is ignored, so the instructions can be written as a single paragraph, each on a new line, or separated by blank lines for legibility.
198+
199+
### Using the settings page
200+
201+
{% data reusables.copilot.jetbrains-settings %}
202+
{% data reusables.copilot.jetbrains-languages-and-frameworks %}
203+
1. Under "{% data variables.product.prodname_copilot_short %} Instructions", click **Workspace** or **Global** to choose whether the custom instructions apply to the current workspace or all workspaces.
204+
205+
### Manually creating a workspace custom instructions file
206+
207+
1. In the root of your repository, create a file named `.github/copilot-instructions.md`.
208+
209+
Create the `.github` directory if it does not already exist.
210+
211+
1. Add natural language instructions to the file, in Markdown format.
212+
213+
Once saved, these instructions will apply to the current workspace in JetBrains IDEs that you open with {% data variables.product.prodname_copilot_short %} enabled.
214+
215+
### Manually creating a global custom instructions file
216+
217+
To apply the same instructions across all workspaces in JetBrains IDEs, you can create a global custom instructions file on your local machine.
218+
219+
1. Open your file explorer or terminal.
220+
1. Navigate to the appropriate location for your operating system:
221+
222+
* **macOS**:
223+
`/Users/YOUR-USERNAME/.config/github-copilot/intellij/`
224+
* **Windows**:
225+
`C:\Users\YOUR-USERNAME\AppData\Local\github-copilot\intellij\`
226+
227+
1. Create a file named `global-copilot-instructions.md` in that directory.
228+
1. Add your custom instructions in natural language, using Markdown format.
229+
230+
Once saved, these instructions will apply globally across all workspaces in JetBrains IDEs that you open with {% data variables.product.prodname_copilot_short %} enabled.
231+
232+
{% endjetbrains %}
233+
234+
{% xcode %}
235+
236+
You can create a custom instructions file in your repository via the {% data variables.product.prodname_copilot_short %} settings page.
237+
238+
Whitespace between instructions is ignored, so the instructions can be written as a single paragraph, each on a new line, or separated by blank lines for legibility.
239+
240+
1. Open the {% data variables.product.prodname_copilot %} for Xcode application.
241+
1. At the top of the application window, click **Advanced**.
242+
1. To the right of "Custom Instructions", click **Current Workspace** or **Global** to choose whether the custom instructions apply to the current workspace or all workspaces.
243+
244+
{% endxcode %}
245+
246+
{% vscode %}
247+
248+
1. In the root of your repository, create a file named `.github/copilot-instructions.md`.
249+
250+
Create the `.github` directory if it does not already exist.
251+
252+
1. Add natural language instructions to the file, in Markdown format.
253+
254+
Whitespace between instructions is ignored, so the instructions can be written as a single paragraph, each on a new line, or separated by blank lines for legibility.
255+
256+
{% endvscode %}
257+
258+
{% visualstudio %}
259+
145260
1. In the root of your repository, create a file named `.github/copilot-instructions.md`.
146261

147262
Create the `.github` directory if it does not already exist.
148263

149264
1. Add natural language instructions to the file, in Markdown format.
150265

151-
Whitespace between instructions is ignored, so the instructions can be written as a single paragraph, each on a new line, or separated by blank lines for legibility.{% webui %}
266+
Whitespace between instructions is ignored, so the instructions can be written as a single paragraph, each on a new line, or separated by blank lines for legibility.
152267

153-
To see your instructions in action, go to [https://github.com/copilot](https://github.com/copilot), attach the repository containing the instructions file, and start a conversation.{% endwebui %}
268+
{% endvisualstudio %}
269+
270+
{% webui %}
271+
272+
1. In the root of your repository, create a file named `.github/copilot-instructions.md`.
273+
274+
Create the `.github` directory if it does not already exist.
275+
276+
1. Add natural language instructions to the file, in Markdown format.
277+
278+
Whitespace between instructions is ignored, so the instructions can be written as a single paragraph, each on a new line, or separated by blank lines for legibility.
279+
280+
To see your instructions in action, go to [https://github.com/copilot](https://github.com/copilot), attach the repository containing the instructions file, and start a conversation.
281+
282+
{% endwebui %}
154283

155284
{% note %}
156285

@@ -216,16 +345,22 @@ You can click the reference to open the file.
216345

217346
{% endvisualstudio %}
218347

219-
## Enabling or disabling repository custom instructions
348+
{% jetbrains %}
220349

221-
You can choose whether or not you want {% data variables.product.prodname_copilot_short %} to use repository-based custom instructions.
350+
{% data reusables.copilot.custom-instructions-reference %}
222351

223-
### Enabling or disabling custom instructions for {% data variables.copilot.copilot_chat_short %}
352+
{% endjetbrains %}
224353

225-
Custom instructions are enabled for {% data variables.copilot.copilot_chat_short %} by default but you can disable, or re-enable, them at any time. This applies to your own use of {% data variables.copilot.copilot_chat_short %} and does not affect other users.
354+
{% xcode %}
355+
356+
{% data reusables.copilot.custom-instructions-reference %}
357+
358+
{% endxcode %}
226359

227360
{% webui %}
228361

362+
{% data reusables.copilot.custom-instructions-enabling %}
363+
229364
1. On {% data variables.product.prodname_dotcom_the_website %}, do one of the following:
230365
* Go to a repository with a custom instructions file and open the assistive chat panel.
231366
* Go to the immersive view of {% data variables.copilot.copilot_chat_short %} ([github.com/copilot](https://github.com/copilot)) and attach a repository that contains a custom instructions file.
@@ -237,35 +372,36 @@ Custom instructions are enabled for {% data variables.copilot.copilot_chat_short
237372
238373
Your choice persists, for all repositories containing a custom instructions file, until you change it.
239374

375+
{% data reusables.copilot.custom-instructions-enabling-for-ccr %}
376+
240377
{% endwebui %}
241378

242379
{% vscode %}
243380

381+
{% data reusables.copilot.custom-instructions-enabling %}
382+
244383
1. Open the Setting editor by using the keyboard shortcut <kbd>Command</kbd>+<kbd>,</kbd> (Mac) / <kbd>Ctrl</kbd>+<kbd>,</kbd> (Linux/Windows).
245384
1. Type `instruction file` in the search box.
246385
1. Select or clear the checkbox under **Code Generation: Use Instruction Files**.
247386

387+
{% data reusables.copilot.custom-instructions-enabling-for-ccr %}
388+
248389
{% endvscode %}
249390

250391
{% visualstudio %}
251392

393+
{% data reusables.copilot.custom-instructions-enabling %}
394+
252395
1. In the {% data variables.product.prodname_vs %} menu bar, under **Tools**, click **Options**.
253396

254397
![Screenshot of the {% data variables.product.prodname_vs %} menu bar. The "Tools" menu is expanded, and the "Options" item is highlighted with an orange outline.](/assets/images/help/copilot/vs-toolbar-options.png)
255398

256399
1. In the "Options" dialog, type `custom instructions` in the search box, then click **{% data variables.product.prodname_copilot_short %}**.
257400
1. Select or clear the checkbox for **(Preview) Enable custom instructions to be loaded from .github/copilot-instructions.md files and added to requests**.
258401

259-
{% endvisualstudio %}
260-
261-
### Enabling or disabling custom instructions for {% data variables.copilot.copilot_code-review_short %}
402+
{% data reusables.copilot.custom-instructions-enabling-for-ccr %}
262403

263-
Custom instructions are enabled for {% data variables.copilot.copilot_code-review_short %} by default but you can disable, or re-enable, them in the repository settings on {% data variables.product.prodname_dotcom_the_website %}. This applies to {% data variables.product.prodname_copilot_short %}'s use of custom instructions for all code reviews it performs in this repository.
264-
265-
{% data reusables.repositories.navigate-to-repo %}
266-
{% data reusables.repositories.sidebar-settings %}
267-
1. In the "Code & automation" section of the sidebar, click **{% octicon "copilot" aria-hidden="true" aria-label="copilot" %} {% data variables.product.prodname_copilot_short %}**, then **Code review**.
268-
1. Toggle the “Use custom instructions when reviewing pull requests” option on or off.
404+
{% endvisualstudio %}
269405

270406
{% vscode %}
271407

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
### Enabling or disabling custom instructions for {% data variables.copilot.copilot_code-review_short %}
2+
3+
Custom instructions are enabled for {% data variables.copilot.copilot_code-review_short %} by default but you can disable, or re-enable, them in the repository settings on {% data variables.product.prodname_dotcom_the_website %}. This applies to {% data variables.product.prodname_copilot_short %}'s use of custom instructions for all code reviews it performs in this repository.
4+
5+
{% data reusables.repositories.navigate-to-repo %}
6+
{% data reusables.repositories.sidebar-settings %}
7+
1. In the "Code & automation" section of the sidebar, click **{% octicon "copilot" aria-hidden="true" aria-label="copilot" %} {% data variables.product.prodname_copilot_short %}**, then **Code review**.
8+
1. Toggle the “Use custom instructions when reviewing pull requests” option on or off.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## Enabling or disabling repository custom instructions
2+
3+
You can choose whether or not you want {% data variables.product.prodname_copilot_short %} to use repository-based custom instructions.
4+
5+
### Enabling or disabling custom instructions for {% data variables.copilot.copilot_chat_short %}
6+
7+
Custom instructions are enabled for {% data variables.copilot.copilot_chat_short %} by default but you can disable, or re-enable, them at any time. This applies to your own use of {% data variables.copilot.copilot_chat_short %} and does not affect other users.

0 commit comments

Comments
 (0)