Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

GitHub push rulesets can now exempt selected paths from two restrictions: Restrict file paths and Restrict file size. Add the patterns under Allowed exceptions when editing the applicable rule. The capability was announced on August 25, 2026, as a public preview, so check its current status and availability in your GitHub environment before relying on it.

What path exceptions change

A push rule normally applies across its configured scope. An allowed exception creates a path-based carve-out: matching files are skipped by that rule, while the restriction remains in force for other paths. GitHub describes the feature as a way to exempt specific paths while applying a push rule everywhere else in scope. GitHub’s August 25, 2026 announcement identifies the feature as public preview.

Only two push rules currently support allowed exceptions in the GitHub ruleset documentation: file-path restrictions and file-size restrictions. Exceptions do not turn off the ruleset or create a general bypass for other rules.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Which push rules support exceptions?

Rule What the rule restricts Why an exception may help Example approach
Restrict file paths Files matching restricted paths or file types. Permit a particular artifact or location while blocking the broader category elsewhere. Block JAR files generally, but allow **/gradle/wrapper/*.jar, GitHub’s example for Gradle wrapper JAR files at any directory depth.
Restrict file size Files exceeding the configured size limit. Apply a limit without first changing existing oversized files at selected paths. Exempt only the known legacy paths that currently contain files over the threshold, then review whether those files should eventually meet the limit.

The second approach is a rollout option, not an automatic migration: GitHub’s cited documentation does not say that the exception changes, removes, or cleans up oversized files.

How to add an allowed exception

  1. Open the repository rulesets interface and edit the ruleset containing the push restriction. Confirm that you are editing the intended ruleset and scope.
  2. Open either Restrict file paths or Restrict file size and configure the restriction itself.
  3. Expand Allowed exceptions and add the path patterns the rule should skip.
  4. Save the ruleset. GitHub validates the patterns when the ruleset is saved; correct any invalid pattern reported by the interface.
  5. Test representative matching and nonmatching paths in a suitable repository before enforcement. Confirm that the exception permits only the intended files and that the wider rule still blocks the files it should.

Patterns use fnmatch syntax. For example, GitHub documents **/gradle/wrapper/*.jar for Gradle wrapper JAR files at any directory depth. Save-time validation checks pattern validity, but it does not establish whether your exception is narrow enough for your organization’s policy.

How to choose a safe pattern

For a file-path restriction

Start with the broad prohibition, then make the allowed pattern as specific as the legitimate need. If the intended carve-out is Gradle wrapper JARs, use the documented pattern rather than exempting all JAR files. Test paths both inside and outside the approved directory, including a similarly named file in an unintended location.

For a file-size restriction

Identify the existing paths that contain files over the intended threshold before adding exceptions. Exempt only those paths that need temporary or deliberate relief, and keep a record of why each carve-out exists and who should review it. If the files can later be brought under the limit, plan that work separately; the exception itself does not perform it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Limits, availability, and permissions

For the Restrict file paths rule, GitHub documents up to 200 entries and a maximum of 200 characters per entry. The reviewed documentation does not state a separate maximum number of allowed-exception patterns, so do not assume the restriction-entry limit also governs exceptions; check the current interface or API documentation.

GitHub Docs says push rulesets are available on the GitHub Team plan for internal and private repositories, and for forks of repositories where push rulesets are enabled. The page also says repository readers can view rulesets; administrators and custom roles with the edit repository rules permission can create, edit, or delete them. Push-rule bypass permissions apply across the root repository and its fork network. Verify plan eligibility, repository visibility, permissions, and fork-network policy for the repository you are configuring.

Because the feature announcement labels path exceptions a public preview, its lifecycle and plan availability may change. Check the current GitHub interface and documentation before implementing instructions for a particular organization.

Before enforcing the ruleset

  • Verify that the repository is eligible and that the person configuring the ruleset has the required permission.
  • Review who can bypass push rules and how bypass permissions affect the root repository and its fork network.
  • Test the broad restriction against files it should block, then test the exception against approved and unapproved paths.
  • For size limits, document any exempted legacy files and decide whether and when they should be brought into compliance.
  • Revisit exceptions periodically so narrow, justified carve-outs do not become permanent without review.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.