GitHub 新增:自动将分支保护规则迁移为仓库规则集
Automatically migrate branch protection rules to repository rulesets
GitHub 用户注意了:现在可以直接把分支保护规则一键迁移到规则集,省去手动重建的麻烦。建议在仓库设置里试试这个转换工具,尤其是管理多个仓库的团队,能显著提升策略管理效率。
You can now convert your existing branch protection rules to repository rulesets directly from your repository settings. This helps you migrate to GitHub’s more flexible and scalable policy framework without manually recreating each rule.
您现在可以直接从仓库设置中,将现有的分支保护规则转换为仓库规则集。这有助于您迁移到 GitHub 更灵活、可扩展的策略框架,而无需手动重新创建每条规则。
As we continue investing in rulesets as the foundation for repository governance on GitHub, this tool makes it easy to bring your existing policies forward.
随着我们持续投资于规则集作为 GitHub 上仓库治理的基础,此工具让您轻松地将现有策略迁移过来。
How it works
工作原理
Navigate to Settings → Branches in your repository, find the classic rule under Branch protection rules, and click Convert to ruleset. GitHub maps your existing branch protection configuration including required reviews, status checks, and push restrictions into equivalent ruleset rules.
在您的仓库中导航到“设置”→“分支”,在“分支保护规则”下找到经典规则,然后点击“转换为规则集”。GitHub 会将您现有的分支保护配置(包括必需的审查、状态检查和推送限制)映射为等效的规则集规则。
Why migrate to rulesets?
为什么要迁移到规则集?
Rulesets offer several advantages over classic branch protections:
与经典分支保护相比,规则集具有多项优势:
- Apply rules across multiple branches with pattern matching.
- Layer multiple rulesets for granular policy control.
- Manage rulesets at the organization or enterprise level.
- Configure fine-grained bypass permissions for users, teams, and apps.
- 通过模式匹配将规则应用于多个分支。
- 分层使用多个规则集以实现细粒度的策略控制。
- 在组织或企业级别管理规则集。
- 为用户、团队和应用配置细粒度的绕过权限。
Availability
可用性
This feature is available for all repositories where rulesets are available. Learn more about repository rulesets.
此功能适用于所有支持规则集的仓库。了解更多关于仓库规则集的信息。
Join the discussion within GitHub Community.
加入 GitHub Community 中的讨论。
更进一步:量化金融体系
看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力