Skip to main content

Asking Copilot to create a pull request

You can ask Copilot to create a pull request from the Agents page or from Copilot Chat.

Who can use this feature?

Copilot coding agent is available with the GitHub Copilot Pro, GitHub Copilot Pro+, GitHub Copilot Business and GitHub Copilot Enterprise plans. Access for Copilot trials is coming soon. The agent is available in all repositories, except where it has been explicitly disabled and repositories owned by managed user accounts.
Sign up for Copilot

Note

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 Copilot coding agent.

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

Note

  • 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.

    Important

    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