Skip to content

InsightsDevOps

GitHub can now convert all branch protection rules to rulesets at once

On 20 October 2026 GitHub added a bulk import that turns every branch protection rule in a repository into rulesets, with a preview and a choice of enforcement status. What it changes, how rulesets and classic rules combine, and a safe order for migrating.

Published October 26, 20266 min read

On 20 October 2026 GitHub added a bulk conversion for branch protections. Until then you could convert one branch protection rule at a time. Now Settings → Rulesets → Import branch protection rules converts all the rules in a repository in one action. GitHub says it is available for every repository where rulesets are available, and the announcement lists no extra plan requirements.

The announcement is short, so most of what matters is in how rulesets behave. This article covers what the import does, how the old and new mechanisms combine while you migrate, and an order of work that avoids opening up a protected branch by accident.

What the import does

The announcement describes a Review import dialog. Before anything is created, it lets you:

  • Preview the rulesets that will be created.
  • See which branch protection rules are already covered by an existing ruleset.
  • Check cases where one rule produces several rulesets. GitHub does this to preserve the rule's original behaviour when its protections do not fit into a single ruleset.
  • Pick an enforcement status for the new rulesets (Active, Evaluate or Disabled) and select which ones to create.

After Create rulesets, you choose whether to keep or delete the original branch protection rules.

The per-rule conversion that already existed is documented separately. It shows a New behavior section with warnings about anything that will change, and it notes that a single rule can become several rulesets. Read those warnings for the rules you care about most. The bulk dialog is a faster route to the same result, not a promise that every setting maps one to one.

Why move at all

GitHub lists four advantages of rulesets over classic branch protection:

  • Rules apply to many branches through pattern matching.
  • Several rulesets can be layered on the same branch.
  • Rulesets can be managed at the organization or enterprise level.
  • Bypass permissions are fine-grained, down to users, teams and apps.

Two further points from the rulesets documentation matter for platform teams:

  • Anyone with read access can see active rulesets. A developer whose push is rejected can find out why without asking an administrator, and an auditor can review protections without admin rights.
  • Enforcement can be switched without deleting. You can move a ruleset between statuses and keep its definition, which is useful for staged rollouts and for backing out.

Organization-wide rulesets, which target many repositories from one place, require the GitHub Enterprise plan. The limit is 75 rulesets per repository and 75 organization-wide.

How rulesets and branch protection combine

During a migration both mechanisms will usually be active at once, so the combination rules decide whether the migration is safe.

SituationResult
A branch protection rule and a ruleset both match a branchBoth are enforced. A change must satisfy both.
Several rulesets match the same branchRules are combined. Rulesets have no priority order.
The same rule is defined differently in two placesThe most restrictive version applies.

Two consequences follow. A newly created ruleset can only add restrictions on top of an existing branch protection rule, so creating rulesets while keeping the old rules is safe from a "someone can now push" standpoint. And deleting the old rules is the step that can loosen protection, if the ruleset does not cover everything the rule did.

The single-rule documentation adds a helpful signal. If the original rule is kept and a ruleset fully covers it, the Branches page says the rule "is fully covered by rulesets and can be safely deleted". GitHub also recommends checking that the ruleset behaves as expected before deleting.

A migration order that holds up

For one repository the dialog is enough. For a platform team that owns hundreds, the risk is in the order of steps. This sequence uses only behaviour described above.

  1. Inventory first. List which repositories have branch protection rules and which already have rulesets. The dialog shows rules that an existing ruleset already covers, so start with repositories where that is common.
  2. Import with the originals kept. Keep the old rules in place on the first pass. Because both mechanisms are enforced, nothing becomes weaker.
  3. Prefer a non-blocking status where you can. The dialog offers Evaluate as well as Active and Disabled. Evaluate is the status meant for checking a ruleset's effect before it enforces anything. Availability of that mode depends on your plan, which is why the workflow lockfiles article calls it out as Enterprise-only for its own policy. Check what your plan offers before relying on it.
  4. Watch for rejected pushes and pull requests. Because the old rules are still active, the only new failures come from the extra restrictions in the new rulesets. Those are the behaviour differences the conversion warnings tell you about.
  5. Delete the old rules last. Remove them only when the ruleset is the one doing the work, and do it as a separate change from the import so it can be undone independently.

If you decide to delete the originals during the import, do that only for repositories where you have already read the preview and the warnings.

What goes wrong

One rule becomes several rulesets. This is by design, but it changes how you reason about a branch. Where one entry in the branch protection page used to describe the policy, you now have several rulesets that together describe it. Name them so the connection to the original is clear.

Layering hides conflicts. Since rulesets have no priority and the strictest definition wins, adding a second ruleset can make a branch stricter than anyone intended. A required review count of two in one ruleset and one in another means two. Review the combined effect, not each ruleset on its own.

Bypass lists become the new place to look. In classic protection, administrators are often exempt by a single setting. In rulesets, bypass is an explicit list of users, roles, teams or apps. After the import, read each ruleset's bypass list. This is the part most likely to differ from what you remember configuring.

Terraform and other tooling can drift. If branch protection is managed through infrastructure as code, the import creates rulesets outside that code. Decide whether the code or the UI is the source of truth before running the import, and bring the new rulesets under management afterwards, as described in refactoring Terraform state with moved and import blocks.

What to do now

  • Pick one low-risk repository and run the import with the originals kept. Read the preview and the warnings before confirming.
  • Read each resulting ruleset's targets and bypass list.
  • Once the rulesets behave as expected, delete the old rule and confirm that the branch still rejects the pushes it used to reject.
  • Write down your standard set of rulesets for new repositories, so that conversion is a one-time cleanup and not a permanent state.
  • Then move on to the repositories that matter most, such as those that deploy to production or publish packages.

The announcement does not describe any limitations of the bulk import, and it does not say which settings, if any, cannot be represented. Treat the preview dialog as the source of truth for each repository, and test the result on a branch before you remove the rules that have protected it so far.