A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.github.com/en/copilot/get-started/getting-started-with-prompts-for-copilot-chat below:

Getting started with prompts for GitHub Copilot Chat

You can ask Copilot Chat specific questions about your project or general software questions. You can also ask Copilot Chat to write code, fix errors, write tests, and document code.

Use the tabs above to select the environment where you are using Copilot Chat.

Some of the following example prompts use chat participants (preceded by @), slash commands (preceded by /), or chat variables (preceded by #). For more information on keywords in prompts, see Asking GitHub Copilot questions in your IDE.

Ask general software questions

You can ask Copilot Chat general software questions. For example:

Ask questions about your project

You can ask Copilot Chat questions about your project.

To give Copilot the correct context, try some of these strategies:

Write code

You can ask Copilot to write code for you. For example:

When Copilot returns a code block, the response includes options to copy the code, or to insert the code at your cursor, into a new file, or into the terminal.

Ask questions about alerts from GitHub Advanced Security features

You can ask Copilot about security alerts in repositories in your organization from GitHub Advanced Security features (code scanning, secret scanning, and Dependabot alerts). For example:

Set up a new project

Use the /new slash command to set up a new project. For example:

Copilot will suggest a directory structure and provide a button to create the suggested files and contents. To preview a suggested file, select the file name in the suggested directory structure.

Use the /newNotebook slash command to set up a new Jupyter notebook. For example:

Fix, improve, and refactor code

If your active file contains an error, use the /fix slash command to ask Copilot to fix the error.

You can also make general requests to improve or refactor your code.

Write tests

Use the /tests slash command to ask Copilot to write tests for the active file or selected code. For example:

The /tests slash command writes tests for existing code. If you prefer to write tests before writing code (test driven development), omit the /tests command. For example:

Ask questions about Visual Studio Code

Use the @vscode chat participant to ask specific questions about Visual Studio Code. For example:

Ask questions about the command line

Use the @terminal chat participant to ask specific questions about the command line. For example:

Ask general software questions

You can ask Copilot Chat general software questions. For example:

Ask questions about your project

You can ask Copilot Chat questions about your project. To give Copilot the correct context, try some of these strategies:

For example:

Write code

You can ask Copilot to write code for you. For example:

When Copilot returns a code block, the response includes options to copy the code, insert the code into a new file, or preview the code output.

Ask questions about alerts from GitHub Advanced Security features

You can ask Copilot about security alerts in repositories in your organization from GitHub Advanced Security features (code scanning, secret scanning, and Dependabot alerts). For example:

Fix, improve, and refactor code

If your active file contains an error, use the /fix slash command to ask Copilot to fix the error.

You can also make general requests to improve or refactor your code.

Write tests

Use the /tests slash command to ask Copilot to write tests for the active file or selected code. For example:

The /tests slash command writes tests for existing code. If you prefer to write tests before writing code (test driven development), omit the /tests command. For example:

Ask general software questions

You can ask Copilot Chat general software questions. For example:

Ask questions about your project

You can ask Copilot Chat questions about your project. To give Copilot the correct context, try some of these strategies:

For example:

Write code

You can ask Copilot to write code for you. For example:

When Copilot returns a code block, the response includes options to copy the code or to insert the code at your cursor.

Fix, improve, and refactor code

If your active file contains an error, use the /fix slash command to ask Copilot to fix the error.

You can also make general requests to improve or refactor your code.

Write tests

Use the /tests slash command to ask Copilot to write tests for the active file or selected code. For example:

The /tests slash command writes tests for existing code. If you prefer to write tests before writing code (test driven development), omit the /tests command. For example:

Some of the example prompts require you to be in a specific context on the GitHub website. For more information on how to access those contexts, see Asking Copilot Chat questions in different contexts.

Ask general software questions

You can ask Copilot Chat general software questions. For example:

Ask questions about a repository

You can ask Copilot Chat questions about a repository. For example:

Ask questions about a specific file or symbol

You can ask Copilot Chat questions about a specific file or symbol. For example:

Ask questions about a knowledge base

You can ask Copilot Chat questions about a knowledge base. For example:

Ask questions about a specific piece of code

You can ask Copilot Chat questions about a specific piece of code. You might ask a question about a whole file, or a specific line. For example:

If you are asking about a whole file, you could enter:

If you are asking about specific lines, you could enter:

Ask questions about alerts from GitHub Advanced Security products

You can ask Copilot Chat questions about security alerts in repositories in your organization from GitHub Advanced Security features (code scanning, secret scanning, and Dependabot alerts). For example:

Ask Copilot Chat questions in a pull request

You can ask Copilot Chat questions in a pull request. Your question could relate to various elements of the pull request For example:

You might ask for a summary of the changes in the pull request:

You might ask about the changes in a specific file in the pull request:

You might ask about the changes in a specific line in the pull request:

You might ask why a workflow failed:

Ask Copilot Chat questions about a specific issue or discussion

You can ask Copilot Chat questions about a specific issue or discussion. For example:

Ask Copilot Chat questions about a specific commit

You can ask Copilot Chat questions about a specific commit. For example:

Ask general software questions

You can ask Copilot Chat general software questions. For example:

Ask questions about files your project

You can ask Copilot Chat questions about the file that's currently displayed in the editor, or about files you have attached to your conversation in the Copilot Chat panel. To give Copilot the correct context:

For example:

Write code

You can ask Copilot to write code for you. For example:

When Copilot returns a code block, the response includes options to copy the code.

Fix, improve, and refactor code

If your active file contains an error, use the /fix slash command to ask Copilot to fix the error.

You can also make general requests to improve or refactor your code.

Write tests

Use the /tests slash command to ask Copilot to write tests for the active file or selected code. For example:

The /tests slash command writes tests for existing code. If you prefer to write tests before writing code (test driven development), omit the /tests command. For example:


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4