GitHub Push Rules Now Support Path Exceptions (Public Preview)

Vendor claim: GitHub announced that push rules in rulesets now support path exceptions, available in public preview.

This feature lets repository administrators configure push rules more granularly by specifying file‑path patterns that should be ignored by the rule. The rule still applies to the rest of the repository, providing a narrow exemption without disabling the rule entirely.

Two push rules currently support these exceptions:

  • Restrict file paths: Block a file type across the repository while allowing it at specific paths, e.g., block JAR files everywhere except **/gradle/wrapper/*.jar.
  • Restrict file size: Enforce a size limit while exempting paths that already exceed the limit, enabling gradual adoption of size restrictions.

When configuring a supported rule, expand the Allowed exceptions section and add the desired path patterns. GitHub validates the patterns on save, helping you catch syntax errors early.

For the full list of push rules and pattern syntax, see the “available rules for rulesets” documentation linked in the announcement.

Overall, path exceptions add flexibility to repository protection policies, allowing teams to enforce standards while accommodating legacy files or special cases.