关于受保护分支和必需状态检查
受保护分支确保仓库的协作者无法对分支进行不可撤销的更改。 必需状态检查确保在协作者可以对受保护分支进行更改前,所有必需的 CI 测试都已通过。 Branches within repositories that belong to organizations can be configured so that only certain users or teams can push to the branch.
受保护分支在仓库管理员选择保护的分支上阻止 Git 的多个功能。 受保护分支:
- 无法被强制推送
- 无法被删除
- 在必需状态检查通过前,无法将更改合并到其中
Anyone with admin permissions for a repository are always able to push to a protected branch. If you enable branch restrictions, only users or teams that have been given permission can push to a protected branch. 更多信息请参阅”配置受保护分支和必需状态检查“。
.
Note: If "Include administrators" is selected, you've enabled required status checks on the branch, and status checks fail, any attempt to push changes to the protected branch will also fail, even for people with admin permissions.