Skip to main content

Como pedir para o Copilot criar uma pull request

Você pode usar um prompt do Copilot Chat para pedir para o Copilot criar uma pull request.

Quem pode usar esse recurso?

O Agente de codificação do Copilot está disponível usuários do GitHub Copilot Pro+ e clientes do GitHub Copilot Enterprise. Também começamos a distribuir para clientes do GitHub Copilot Business, e você receberá um email assim que o recurso estiver disponível para você.
Sign up for Copilot

Observação

Introduction

You can ask Copilot to work on a task from the Agents page on GitHub, or from Copilot Chat in Visual Studio Code, Visual Studio, JetBrains IDEs and GitHub.com.

Copilot will start working on the task, raise a pull request, then request a review from you when it's finished working. For more information, see About assigning tasks to Copilot.

Asking Copilot to create a pull request from the Agents page

  1. Navigate to the Agents page at github.com/copilot/agents.

    You can also reach this page by clicking the button next to the search bar on any page on GitHub, then selecting Agents from the sidebar.

  2. Using the dropdown menu in the prompt field, select the repository you want Copilot to work in.

  3. Type a prompt describing your request.

    For example, Implement a user friendly message for common errors.

Screenshot of asking Copilot to create a pull request from the Agents page.

  1. Click the Send now button or press Return.

    Copilot will start a new session, which will appear in the list below the prompt box. Copilot will work on the task and push changes to its pull request, then add you as a reviewer when it has finished, triggering a notification.

Asking Copilot to create a pull request from Copilot Chat

Observação

  • You can ask Copilot to create a pull request from Copilot Chat in Visual Studio Code, Visual Studio, JetBrains IDEs, and on GitHub.com.
  1. Open GitHub Copilot Chat, in your IDE or on GitHub.com.

  2. Type a prompt asking Copilot to create a pull request, and giving details of what you want Copilot to change.

    For example, @github Create a PR to put backticks around file names and variables in output.

    Importante

    In VS Code, Visual Studio, and JetBrains IDEs, you must mention the @github chat participant in your prompt. You can omit this in Copilot Chat on GitHub.com.

  3. Submit your prompt.

    Copilot asks you to confirm that you want to use the coding agent to create a pull request.

  4. Click Allow.

    Copilot will start a new session and respond with a link to the pull request it creates. It will work on the task and push changes to the pull request, and then add you as a reviewer when it has finished, triggering a notification.

Monitoring progress

You can view your current and past Copilot sessions from the Agents page. See Tracking Copilot's sessions.

You can see what Copilot is doing while it is working on a task by viewing the session logs. You can access the session logs by clicking the View session button in the timeline of Copilot's pull request.

From the session logs page, you can also stop Copilot from working on a task by clicking Stop session.

Further reading