Skip to main content

Asking Copilot to create a pull request

You can use a Copilot Chat prompt to ask Copilot to create a 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

  • If you have access to Agente de codificação do Copilot, you can create a pull request from Copilot Chat in Visual Studio Code, Visual Studio, JetBrains IDEs, and on GitHub.com.
  • O Agente de codificação do Copilot está em versão prévia pública e está sujeito a alterações. Durante a versão prévia, o uso do recurso está sujeito a Termos de licença de pré-lançamento do GitHub.

Introduction

Often, when you are working on a project, you might notice a change you want to make, but the change doesn't directly relate to your current task. You might raise a GitHub issue to record that a change needs to be made—or perhaps, forget the change and move on.

Instead—if Agente de codificação do Copilot is available—you can ask Copilot to make the change for you. Copilot will start working on the change in the background and, when it's done, request you to review the pull request it raises.

For information on making Agente de codificação do Copilot available, see Enabling Copilot coding agent.

Creating a pull request from Copilot Chat

  1. Open GitHub Copilot Chat, in your IDE, or while viewing a file 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

    Em IDEs do VS Code, Visual Studio e do JetBrains, você deve mencionar o participante do chat @github em seu prompt. Você pode omitir isso no Copilot Chat no GitHub.com.

    Dica

    To help Copilot, you can select the relevant line(s) of code before submitting your prompt.

  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 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 see what Copilot is doing while it is working on a task by viewing the session logs. See Using the Copilot coding agent logs.

You can also stop Copilot from working on a task by clicking Stop session in the session logs.

Further reading