Skip to main content

定义拉取请求的可合并性

您可以要求拉取请求在可以合并之前先通过一组检查。 例如,您可以阻止未通过状态检查的拉取请求,或要求拉取请求在获得特定数量的批准审查之后才可合并。

受保护分支适用于具有 GitHub Free 和组织的 GitHub Free 的公共仓库,以及具有 GitHub Pro、GitHub Team、GitHub Enterprise Cloud 和 GitHub Enterprise Server 的公共和私有仓库。 有关详细信息,请参阅“GitHub 的产品”。

  • About protected branches

    You can protect important branches by setting branch protection rules, which define whether collaborators can delete or force push to the branch and set requirements for any pushes to the branch, such as passing status checks or a linear commit history.

  • Managing a branch protection rule

    You can create a branch protection rule to enforce certain workflows for one or more branches, such as requiring an approving review or passing status checks for all pull requests merged into the protected branch.

  • Troubleshooting required status checks

    You can check for common errors and resolve issues with required status checks.