Skip to main content

Demander à Copilot de créer une requête de tirage

Vous pouvez utiliser un prompt Copilot Chat pour demander à Copilot de créer une demande de tirage.

Qui peut utiliser cette fonctionnalité ?

Agent de codage Copilot est disponible pour les utilisateurs GitHub Copilot Pro+ et les clients GitHub Copilot Enterprise. Nous avons également commencé le déploiement auprès des clients GitHub Copilot Business, et vous recevrez un e-mail dès que la fonctionnalité sera disponible pour vous.
Sign up for Copilot

Remarque

Introduction

You can ask Copilot to work on a task from:

  • The Agents page on GitHub
  • Copilot Chat in Visual Studio Code, Visual Studio, JetBrains IDEs and GitHub.com
  • Your preferred IDE or agentic coding tool with Model Context Protocol (MCP) support

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 in Visual Studio Code

  1. Install the GitHub Pull Requests extension for Visual Studio Code.

  2. Open GitHub Copilot Chat in Visual Studio Code.

  3. Type a prompt explaining what you want Copilot to do, and add #copilotCodingAgent to the prompt.

    For example, Put backticks around file names and variables in output #copilotCodingAgent

    Conseil

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

    Copilot will typically do some research and context-gathering in Visual Studio Code, and then will ask you to confirm that you want to use the coding agent to create a pull request.

  5. Click Continue.

    Copilot will push up any local changes, 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.

Asking Copilot to create a pull request from Copilot Chat in other IDEs

  1. Open GitHub Copilot Chat in Visual Studio or JetBrains IDEs.

  2. Type a prompt, starting with @github, 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.

    Conseil

    • To help Copilot, you can select the relevant line(s) of code before submitting your prompt.
    • From Copilot Chat, you can ask Copilot to open a pull request using a specific branch as the base branch by including it in 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 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.

Asking Copilot to create a pull request from Copilot Chat in GitHub.com

  1. Open GitHub Copilot Chat 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, Create a PR in monalisa/bookstore to put backticks around file names and variables in output.

    Conseil

    • You can ask Copilot to open a pull request using a specific branch as the base branch by including it in 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 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.

Asking Copilot to create a pull request from the GitHub MCP server

As an alternative to using Copilot Chat, you can use the remote GitHub MCP server to trigger Copilot coding agent from any MCP host.

Remarque

  • This capability is only available on the remote GitHub MCP server and host applications where remote MCP servers are supported.
  1. Install the GitHub MCP server in your preferred IDE or agentic coding tool. See Using the GitHub MCP Server.

  2. Ensure the create_pull_request_with_copilot tool is enabled.

  3. Open chat.

  4. Type a prompt asking Copilot to create a pull request, with the details of what you want to change.

    For example, Open a PR in my repository to expand unit test coverage.

    Conseil

    • You can ask Copilot to open a pull request using a specific branch as the base branch by including it in your prompt.
  5. Submit your prompt.

    Copilot will start a new session, open a draft pull request and work on the task in the background. As it works, it will push changes to the pull request, and once it has finished, it will add you as a reviewer. In most cases, the MCP host will show you the URL of the created pull request.

Monitoring progress

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

Further reading