Skip to main content

要求 GitHub Copilot 对现有拉取请求进行更改

可以通过提及@copilot来要求 Copilot 更改由人工创建的现有拉取请求。

谁可以使用此功能?

Copilot 编码智能体 可用于 GitHub Copilot Pro、GitHub Copilot Pro+、GitHub Copilot Business 和 GitHub Copilot Enterprise 计划。 该代理在 GitHub 上存储的所有仓库中均可用,但以下情况除外:由 托管用户帐户 拥有的仓库,以及已显式禁用该代理的仓库。
Sign up for Copilot

注意

For an overview of Copilot coding agent, see About GitHub Copilot coding agent.

Introduction

You can ask Copilot to make changes to an existing pull request created by a human developer.

Copilot will create a child pull request, using the existing pull request's branch as the base branch. Once it has finished work on the changes you requested, it requests your review on the child pull request.

You maintain control of the original pull request: until you accept Copilot's proposed changes by merging its child pull request into your branch, the pull request will remain untouched.

You can ask Copilot to make changes to its child pull request by leaving a review. See Reviewing a pull request created by GitHub Copilot.

Asking Copilot to make changes

  1. Navigate to the pull request that you want Copilot to make changes to.
  2. Leave a comment or review mentioning Copilot with @copilot.

Copilot will open a child pull request, using the existing pull request's branch as the base branch.

Copilot will leave a comment linking to the new pull request. Once the agent finishes work, it will request a review from you.

Monitoring progress

You can view your current and past Copilot sessions from the agents panel, agents page, Visual Studio Code, and more. See Tracking GitHub Copilot's sessions.

Further reading