Introduction
You can use Copilot to get answers to coding-related questions, such as how best to code something, how to fix a bug, or how someone else's code works. For full details of what Copilot can do, see What is GitHub Copilot?.
If you have access to Copilot Workspace, Copilot can also help you when you are editing files in a pull request on the GitHub website by offering you code completion suggestions. For more information about Copilot Workspace, see Using Copilot to help you work on a pull request.
Instructions for using Copilot differ depending on where you are using it. This version of the quickstart is for GitHub. Click the tabs above for instructions on using Copilot in other environments.
Prerequisite
To use GitHub Copilot on the GitHub website, you must have an active GitHub Copilot subscription. For information about how to get access to Copilot, see What is GitHub Copilot?.
Asking your first question
-
On GitHub, navigate to a repository and open a file.
-
Click the Copilot icon () at the top right of the file view.
-
Type a question in the "Ask Copilot" box at the bottom of the chat panel and press Enter.
For example, you could enter:
- Explain this file.
- How could I improve this code?
- How can I test this code?
Copilot responds to your request in the panel.
-
You can continue the conversation by asking a follow-up question. For example, you could type "tell me more" to get Copilot to expand on its last comment.
Other questions you can ask
There are many more things you can do with GitHub Copilot Chat in GitHub. For example:
- Ask a general question about software development
- Ask exploratory questions about a repository
- Ask a question about a knowledge base
- Find out about the changes in a pull request
- Ask a question about a specific issue or commit
For more information, see Asking GitHub Copilot questions in GitHub.
Next steps
- Find out more about GitHub Copilot Chat - See Asking GitHub Copilot questions in your IDE and Asking GitHub Copilot questions in GitHub.
- Get Copilot code completion suggestions in an IDE - See Getting code suggestions in your IDE with GitHub Copilot.
- Learn how to write effective prompts - See Prompt engineering for Copilot Chat.
- Use Copilot on your mobile device - See Asking GitHub Copilot questions in GitHub Mobile.
- Use Copilot on the command line - See Using GitHub Copilot in the command line.