GitHub 集成

Copilot 不只是 IDE 插件。同一套账号在 github.com 上可以问文件、Issue、Pull Request,生成 PR 摘要,并让 Copilot 审查 变更。权威总入口仍是 Copilot 文档站。网站 Quickstart:Quickstart for GitHub Copilot(切到 GitHub website 标签)。

Windows 与 macOS 都用浏览器;没有单独的「网站版安装包」。差在稍后你用哪套编辑器拉分支。


在文件页提问

  1. 打开仓库里的某个文件。
  2. 点击页面右上角 Copilot 图标,打开 Chat 面板。
  3. 提问后回车。官方示例:
Explain this file.
How could I improve this code?
How can I test this code?

可以追问 tell me more。新话题点面板上的 +,避免旧对话污染上下文。

这适合「在网页里扫一眼仓库」,不必为了一句解释克隆整个项目。回答仍可能过时或漏读私有模块——把结论当线索,回到 IDE 或测试里验证。


Issue:提问、起草、交给 Agent

在 Issue 页打开同一 Copilot 面板,可以问:

Summarize this issue for a developer who has never seen the repo.
What files are likely involved? Cite paths only if you can see them.

你也可以让 Copilot 协助创建或更新 Issue(自然语言甚至图片),见官方 Using GitHub Copilot to create or update issues。生成后仍要人改标题、标签与复现步骤。

要把实现交给云端 Agent:Assignees 选 Copilot。规则与限制见 Coding Agent——指派之后请到 PR 上跟进,而不是继续往 Issue 里堆只有人类能看见的评论。


Pull Request:摘要、问答、审查

生成描述摘要

创建或编辑 PR 时,在描述框标题栏打开 Copilot 菜单,选 Summary。官方提示:Copilot 不会把你已经写在描述里的文字当输入,所以空白描述再生成更干净。生成后必须人工补上「为什么改、怎么测、风险」。

文档:Helping others review your changes 中的 Copilot summary 一节。

对着 PR 聊天

在 PR 页点 Copilot 图标,PR 会作为上下文。例如:

Summarize this pull request
What are the main changes in this pull request?
What problem does this pull request solve?

教程:Using GitHub Copilot to explore pull requests。也可以把 commit SHA 写进问题里,例如 What changed in commit a778e0eab?

Copilot code review

GitHub 可以让 Copilot 审查 PR 并给出可一键应用的建议。能力与是否默认开启取决于套餐和组织设置,见文档站 About GitHub Copilot code reviewUsing GitHub Copilot code review on GitHub

重要约束(官方):

  • Copilot 的审查 不能 代替必需的人类审查人数
  • 你仍要自己看 diff:逻辑漏洞、密钥、依赖变更
  • 对 Copilot 自己开出的 PR,用同样标准审(Review output from Copilot

仓库管理员可配置何时自动审查、用什么 runner,见 Configuring code review by GitHub Copilot


Agents 面板与 /task

站点导航的 Agents 入口、github.com/copilot/agents、以及 Chat 里的 /task,都会进云端会话。选仓库、写提示、可选配图,然后跟踪会话。这与 IDE 无关,笔记本休眠也不影响云端任务(仍受套餐与政策限制)。


GitHub MCP 与 Chat

在 github.com 的 Copilot Chat 里,官方提供 GitHub MCP Server 一类能力:在对话中执行「建分支、搜用户」等 GitHub 操作,且「无需额外搭建」。以 Using the GitHub MCP Server from Copilot Chat 为准。这不等于给你任意仓库的写权限——仍受你的 GitHub 权限与组织政策约束。自建 MCP 见本站 MCP 教程


Mobile

GitHub Mobile 上也有 Copilot Chat。Business / Enterprise 在移动端能搜的知识范围可能更广(例如组织知识),以当前套餐矩阵为准。不要在手机上批准未读完的 Agent PR。


和本地工作流怎么接

在 github.com回到本机(Windows / macOS 相同命令)
审完 Copilot 的 PRgit fetch 后检出 PR 分支,跑测试
只要网页解释不必克隆
要改多文件且想盯着 diff用 VS Code Chat 或本站 Cursor

密钥仍不要进 Issue 正文。需要 Agent 访问私有资源时,走官方 Configure secrets and variables for Copilot cloud agent,不要把 token 贴进评论。


下一步

评论