我们经常发布文档更新,此页面的翻译可能仍在进行中。有关最新信息,请访问英文文档。如果此页面上的翻译有问题,请告诉我们
文章版本: Enterprise Server 2.15

此版本的 GitHub Enterprise 将停止服务 此版本的 GitHub Enterprise 已停止服务 2019-10-16. 即使针对重大安全问题,也不会发布补丁。 For better performance, improved security, and new features, upgrade to the latest version of GitHub Enterprise. For help with the upgrade, contact GitHub Enterprise support.

关于拉取请求的必需审查

必需审查确保拉取请求获得特定数量的审批审查之后,协作者才可更改受保护分支。

受保护分支可用于具有 GitHub Free 的公共仓库,以及具有 GitHub Pro、GitHub Team、GitHub Enterprise Cloud 和 GitHub Enterprise Server 的公共和私有仓库。

如果您在仓库中实施了分支保护,便可设置必需审查。 有关实施分支保护的更多信息,请参阅“配置受保护分支”。有关设置必需审查的更多信息,请参阅“对拉取请求启用必需审查”。

Repository administrators can require that all pull requests receive a specific number of approving reviews from people with write or admin permissions in the repository or from a designated code owner before they're merged into a protected branch. 更多信息请参阅“关于受保护分支”。

When required reviews are enabled, anyone with access to the repository can approve changes in a pull request. However, you won't be able to merge your pull request until the required number of reviewers with write or admin permissions in the repository approve your pull request's changes in their review. For more information about repository permission levels, see "Repository permission levels for an organization." If review is required from a designated code owner and the pull request affects code that has a designated owner, approval from that owner is required.

If a person with admin permissions chooses the Request changes option in a review, then that person must approve the pull request before it can be merged. If a reviewer who requests changes on a pull request isn't available, anyone with admin or write permission for the repository can dismiss the blocking review. 更多信息请参阅“忽略拉取请求审查”。

注:仓库管理员可以限制对特定的人员或团队忽略拉取请求审查。 更多信息请参阅“启用拉取请求的必需审查”。

如果将代码修改提交推送到已批准拉取请求的分支,在仓库管理员设置了旧审查忽略时可能会忽略审批。 如果您推送非代码修改提交,例如将基本分支合并到拉取请求的分支,这不适用。

除非必需审查已设置为包含仓库管理员,则具有管理员权限的人员就可以合并拉取请求,而不管其他管理员是否审查。

在所有必需审查者批准了拉取请求后,如果有其他打开拉取请求的审查为待定或拒绝,并且这些拉取请求有一个头部分支指向同一个提交,则将无法合并它。需要有写入管理员权限的人批准其他拉取请求的审查或取消对其的阻止之后才能合并。

You can't merge a pull request into a protected branch until someone with write or admin permissions approves it. 如果存在待处理或拒绝的审查,您会收到错误消息:

remote: error: GH006: Protected branch update failed for refs/heads/master.
remote: error: Changes have been requested.

问问别人

找不到要找的内容?

联系我们