Skip to main content

Using GitHub Codespaces for pull requests

You can use GitHub Codespaces in your development workflow to create pull requests, review pull requests, and address review comments.

GitHub Codespaces 可用于使用 GitHub Team 或 GitHub Enterprise Cloud 的组织。 GitHub Codespaces 也可作为受限的 beta 版本提供给使用 GitHub Free 和 GitHub Pro 计划的个人用户。 有关详细信息,请参阅“GitHub 的产品”。

About pull requests in GitHub Codespaces

GitHub Codespaces provides you with many of the capabilities you might need to work with pull requests:

  • Create a pull request - Using either the Terminal and Git commands or the Source Control view, you can create pull requests just as you would on GitHub.com. If the repository uses a pull request template, you'll be able to use this within the Source Control view.
  • Open a pull request – You can open an existing pull request in a codespace, provided you have codespace access to the branch that is being merged in.
  • Review a pull request - Once you have opened a pull request in a codespace, you can use the "GitHub Pull Request" view to add review comments and approve pull requests. You can also use GitHub Codespaces to view review comments.

Opening a pull request in Codespaces

  1. 在存储库名称下,单击 “拉取请求”。 问题和拉取请求选项卡选择

  2. In the list of pull requests, click the pull request you'd like to open in GitHub Codespaces.

  3. On the right-hand side of your screen, click Code.

  4. In the Codespaces tab, click Create codespace on BRANCH. Option to open PR in a codespace

Reviewing a pull request in Codespaces

  1. 在代码空间中打开拉取请求,如“打开拉取请求”中所述。
  2. 在活动栏中,单击“GitHub 拉取请求”视图。 仅当在代码空间中打开拉取请求时,才会显示此视图。 用于在代码空间中打开 PR 的选项
  3. 若要查看特定文件,请单击侧栏中的“打开文件”图标。 用于在代码空间中打开 PR 的选项
  4. 若要添审阅注释,请单击行号旁边的 + 图标。 键入审阅注释,然后单击“开始审阅”。 用于在代码空间中打开 PR 的选项
  5. 添加完审阅注释后,你可以从侧栏中选择提交评论、批准更改或请求更改。 用于在代码空间中打开 PR 的选项

For more information on reviewing a pull request, see "Reviewing proposed changes in a pull request."

View comments from a review in Codespaces

Once you have received feedback on a pull request, you can open it in a codespace to see the review comments. From there you can respond to comments, add reactions, or dismiss the review.

Option to open PR in a codespace