11 KiB
title, shortTitle, intro, product, versions, topics, redirect_from, contentType
| title | shortTitle | intro | product | versions | topics | redirect_from | contentType | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Asking GitHub Copilot to create a pull request | Create a PR | You can ask {% data variables.product.prodname_copilot_short %} to create a pull request from many places, including the agents panel, {% data variables.copilot.copilot_chat_short %}, and agentic coding tools and IDEs with Model Context Protocol (MCP) support. | {% data reusables.gated-features.copilot-coding-agent %}<br><a href="https://github.com/features/copilot/plans?ref_cta=Copilot+plans+signup&ref_loc=asking+copilot+to+create+a+pull+request&ref_page=docs" target="_blank" class="btn btn-primary mt-3 mr-3 no-underline"><span>Sign up for {% data variables.product.prodname_copilot_short %}</span> {% octicon "link-external" height:16 %}</a> |
|
|
|
how-tos |
Note
- {% data reusables.copilot.coding-agent.preview-note-text %}
- For an overview of {% data variables.copilot.copilot_coding_agent %}, see AUTOTITLE.
Introduction
You can ask {% data variables.product.prodname_copilot_short %} to work on a task from:
- The agents panel, available across {% data variables.product.github %}
- The agents page on {% data variables.product.github %}
- {% data variables.copilot.copilot_chat_short %} in {% data variables.product.prodname_vscode %}, {% data variables.product.prodname_vs %}, JetBrains IDEs and {% data variables.product.prodname_dotcom_the_website %}
- Your preferred IDE or agentic coding tool with Model Context Protocol (MCP) support
- The Raycast launcher on macOS
{% data variables.product.prodname_copilot_short %} 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 AUTOTITLE.
Asking {% data variables.product.prodname_copilot_short %} to create a pull request from the agents panel or page
You can ask {% data variables.product.prodname_copilot_short %} to open a pull request from either the agents panel or the agents page. The only difference is the entry point - once you see the "New agent task" form, the steps are the same.
-
Open the agents panel or page:
- Open the agents panel: Click {% octicon "agent" aria-label="The Agents icon" %} in the navigation bar at the top right of {% data variables.product.github %}.
- Navigate to the agents page: Go to github.com/copilot/agents. You can also get here by opening the agents panel, then clicking View all.
{% data reusables.copilot.coding-agent.new-agent-task-form-instructions %}
Asking {% data variables.product.prodname_copilot_short %} to create a pull request from {% data variables.copilot.copilot_chat_short %} in {% data variables.product.prodname_vscode %}
-
Install the {% data variables.product.github %} Pull Requests extension for {% data variables.product.prodname_vscode %}.
-
Open {% data variables.copilot.copilot_chat %} in {% data variables.product.prodname_vscode %}.
-
Type a prompt explaining what you want {% data variables.product.prodname_copilot_short %} to do, and add
#copilotCodingAgentto the prompt.For example,
Put backticks around file names and variables in output #copilotCodingAgentTip
- To help {% data variables.product.prodname_copilot_short %}, you can select the relevant line(s) of code before submitting your prompt.
-
Submit your prompt.
{% data variables.product.prodname_copilot_short %} will typically do some research and context-gathering in {% data variables.product.prodname_vscode %}, and then will ask you to confirm that you want to use the coding agent to create a pull request.
-
Click Continue.
{% data variables.product.prodname_copilot_short %} 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 {% data variables.product.prodname_copilot_short %} to create a pull request from {% data variables.copilot.copilot_chat_short %} in other IDEs
-
Open {% data variables.copilot.copilot_chat %} in {% data variables.product.prodname_vs %} or JetBrains IDEs.
-
Type a prompt, starting with
@github, asking {% data variables.product.prodname_copilot_short %} to create a pull request, and giving details of what you want {% data variables.product.prodname_copilot_short %} to change.For example,
@github Create a PR to put backticks around file names and variables in output.Tip
- To help {% data variables.product.prodname_copilot_short %}, you can select the relevant line(s) of code before submitting your prompt.
- From {% data variables.copilot.copilot_chat_short %}, you can ask {% data variables.product.prodname_copilot_short %} to open a pull request using a specific branch as the base branch by including it in your prompt.
-
Submit your prompt.
{% data variables.product.prodname_copilot_short %} asks you to confirm that you want to use the coding agent to create a pull request.
-
Click Allow.
{% data variables.product.prodname_copilot_short %} 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 {% data variables.product.prodname_copilot_short %} to create a pull request from {% data variables.copilot.copilot_chat_short %} in {% data variables.product.prodname_dotcom_the_website %}
-
Open {% data variables.copilot.copilot_chat %} on {% data variables.product.prodname_dotcom_the_website %}.
-
Type a prompt asking {% data variables.product.prodname_copilot_short %} to create a pull request, and giving details of what you want {% data variables.product.prodname_copilot_short %} to change.
For example,
Create a PR in monalisa/bookstore to put backticks around file names and variables in output.Tip
- You can ask {% data variables.product.prodname_copilot_short %} to open a pull request using a specific branch as the base branch by including it in your prompt.
-
Submit your prompt.
{% data variables.product.prodname_copilot_short %} asks you to confirm that you want to use the coding agent to create a pull request.
-
Click Allow.
{% data variables.product.prodname_copilot_short %} 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 {% data variables.product.prodname_copilot_short %} to create a pull request from the {% data variables.product.github %} MCP server
As an alternative to using {% data variables.copilot.copilot_chat_short %}, you can use the remote {% data variables.product.github %} MCP server to trigger {% data variables.copilot.copilot_coding_agent %} from any MCP host.
Note
- This capability is only available on the remote {% data variables.product.github %} MCP server and host applications where remote MCP servers are supported.
-
Install the {% data variables.product.github %} MCP server in your preferred IDE or agentic coding tool. See AUTOTITLE.
-
Ensure the
create_pull_request_with_copilottool is enabled. -
Open chat.
-
Type a prompt asking {% data variables.product.prodname_copilot_short %} 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.Tip
- You can ask {% data variables.product.prodname_copilot_short %} to open a pull request using a specific branch as the base branch by including it in your prompt.
-
Submit your prompt.
{% data variables.product.prodname_copilot_short %} 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.
Asking {% data variables.product.prodname_copilot_short %} to create a pull request from Raycast
{% data reusables.copilot.coding-agent.raycast-intro %}
{% data reusables.copilot.coding-agent.raycast-setup %}
-
Open Raycast, search for "{% data variables.product.prodname_copilot_short %}," find the Create Task command, then press Enter.
-
Click Sign in with {% data variables.product.github %}, then complete the authentication flow. Raycast will re-open.
-
Type a prompt describing what you want {% data variables.product.prodname_copilot_short %} to do.
For example,
Implement a user friendly message for common errors. -
Select the repository you want {% data variables.product.prodname_copilot_short %} to work in.
-
Optionally, select a base branch for {% data variables.product.prodname_copilot_short %}'s pull request. {% data variables.product.prodname_copilot_short %} will create a new branch based on this branch, then push the changes to a pull request targeting that branch.
-
Press Command+Enter to start the task.
{% data variables.product.prodname_copilot_short %} will start a new session. {% data variables.product.prodname_copilot_short %} 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.
Note
If you are unable to select a specific repository when starting a task, the organization that owns the repository may have enabled {% data variables.product.prodname_oauth_app %} access restrictions. To learn how to request approval for the "{% data variables.product.prodname_copilot %} for Raycast" {% data variables.product.prodname_oauth_app %}, see AUTOTITLE.
Monitoring progress
You can view your current and past {% data variables.product.prodname_copilot_short %} sessions from the agents panel, agents page and {% data variables.product.prodname_vscode %}. See AUTOTITLE.