What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
GitHub push rulesets can now exempt selected file paths from two restrictions: Restrict file paths and Restrict file size. Configure patterns under Allowed exceptions when editing a ruleset. The feature 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 ruleset restriction still applies across its scope, except when a file path matches an allowed exception. This gives a team a way to keep a broad rule while carving out a deliberate, narrower allowance. GitHub describes the feature in its August 25, 2026 announcement.
As an Amazon Associate I earn from qualifying purchases.
Only two push rules currently support exceptions in GitHub’s ruleset documentation:
- Restrict file paths: block files matching a path or type, while permitting matching exception paths.
- Restrict file size: enforce a size threshold while permitting matching paths that already contain files larger than that limit.
Choose the right rule and carve-out
| Rule | What it controls | When an exception may help | Example or operational approach |
|---|---|---|---|
| Restrict file paths | Files matching restricted paths or types | A specific artifact is intentionally required in a narrow location | GitHub’s example blocks JAR files generally while allowing **/gradle/wrapper/*.jar for Gradle wrapper files at any directory depth. |
| Restrict file size | Files exceeding the configured size limit | Existing files at particular paths exceed a newly adopted threshold | Identify the existing oversized paths, exempt only those needed, and decide whether to bring them into compliance later. |
The size-rule exception addresses matching paths that already contain over-limit files; it should not be treated as a general exemption for unrelated paths or as an automatic cleanup or migration mechanism.
#1 Best Overall
Configure an allowed exception
- Open the repository’s ruleset for editing, then configure either Restrict file paths or Restrict file size.
- Expand Allowed exceptions and add the path pattern or patterns the rule should skip.
- Save the ruleset. GitHub validates patterns when the ruleset is saved.
- Test the intended behavior in a suitable repository: confirm that paths matching the restriction are blocked and that only the intended exception paths pass.
Allowed-exception patterns use fnmatch syntax. For example, **/gradle/wrapper/*.jar matches Gradle wrapper JAR files at any directory depth. Under the file-size rule, a matching file may exceed the configured limit.
For Restrict file paths, GitHub documents a maximum of 200 entries, with up to 200 characters in each entry. The documentation does not state a separate maximum number of allowed-exception patterns; do not assume the restriction-entry limit applies to exceptions.
Rank #2
Check eligibility, access, and scope
GitHub Docs lists push rulesets as available on the GitHub Team plan for internal and private repositories, and for forks of repositories that have push rulesets enabled. Because the feature announcement labels path exceptions a public preview, verify the current lifecycle status and plan eligibility for your specific repository before rollout.
Anyone with repository read access can view repository rulesets. Administrators and custom roles with the edit repository rules permission can create, edit, and delete them. Push-rule bypass permissions apply across the root repository and its fork network, so include that network-wide scope in the policy review.
Rank #3
Roll out exceptions deliberately
- Use the narrowest path that represents the legitimate need rather than exempting a broad directory or file type.
- For a file-type restriction, test both the general block and the approved exception, including nearby paths that should remain blocked.
- For a size restriction, identify which existing paths need temporary relief and decide whether and when those files should meet the threshold.
- Review who can bypass push rules as well as who can edit the ruleset.
- Treat save-time validation as a syntax check, not proof that an exception is narrow enough for your organization’s policy.
These rollout checks follow from the documented behavior; GitHub’s documentation does not claim that the feature automatically reviews policy intent or cleans up exempted files.
Quick Recap
Best Value
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.




