Skip to main content

Quickstart for using GitHub Copilot on GitHub.com

Understand code and work faster by asking questions and assigning coding tasks to Copilot cloud agent without leaving GitHub.

GitHub Copilot is built into GitHub, so you can use it without installing anything.

This quickstart shows how to ask questions about code and assign a coding task to Copilot cloud agent. It takes about ten minutes.

Step 1: Ask Copilot about a file

  1. Try these prompts to explore specific files in the github/docs repository.

    Copilot prompt
    In `github/docs`, look at `/package.json` and explain what this file does.
    
    Copilot prompt
    In `github/docs`, look at `/src/color-schemes/tests/color-mode-script.ts` and share how I could improve this code.
    

Next, open a file in a repository of your choice and ask Copilot questions about it.

  1. Navigate to any repository you want to explore. It doesn't need to be your own.

  2. Open any file in the repository.

  3. Click the Copilot icon () at the top right of the file view.

  4. In the prompt box, type a question and press Enter. For example:

    • Explain what this file does.
    • How could I improve this code?
    • What tests would cover this function?
    • What was the last change and why was it made?

    Copilot responds in the chat panel.

  5. Ask follow-up questions to explore the code further. For example:

    • Tell me more to get Copilot to expand on its last comment
    • Ask exploratory questions about a repository
    • Explain the changes in a pull request
    • Ask a question about a specific issue or commit

For more information, see Hacer preguntas a GitHub Copilot en GitHub.

Step 2: Assign an issue to Copilot

Nota:

To use Copilot cloud agent in this quickstart, upgrade to a paid plan such as Copilot Pro.

Without access to a paid plan, you can instead learn about the remaining steps by using Copilot in your preferred editor. See Quickstart for using GitHub Copilot in your IDE.

Copilot cloud agent can work on coding tasks autonomously. Assigning an issue is the easiest way to start, and Copilot creates a pull request when it finishes.

  1. In a personal repository you have write access to, enable Copilot cloud agent from your Copilot settings.

    • To enable Copilot cloud agent for repositories in an organization or enterprise instead, see Habilitar Copilot for further instructions.
  2. Find an existing issue you'd like Copilot to work on, or create a new issue.

  3. Open the issue. In the right sidebar of the issue, click Assignees.

  4. Click Copilot from the assignees list.

  5. Optionally, add context in the Optional prompt field—for example, coding patterns, files to modify, or testing requirements.

Copilot uses the issue title, description, and existing comments. Add follow-up information directly to the pull request after it opens.

Step 3: Review the resulting pull request

When Copilot finishes the task, it opens a pull request and requests your review.

  1. Open the pull request that Copilot created.
  2. Review the diff and verify the changes match what you intended.
  3. To request changes, mention @copilot in a comment on the pull request, or push commits directly to the branch.
  4. When you're satisfied with the changes, merge the pull request.

For more information, see Revisar la salida de Copilot.

Next steps