After creating a ruleset, you can make changes to the ruleset to alter how people can interact with the targeted branches or tags. For example, you can add rules to better protect your branches or tags, or you can temporarily disable a ruleset to troubleshoot any unintended effects on the contributor experience for your repository.
You can use the REST and GraphQL APIs to manage rulesets. For more information, see "Rules" and "Mutations."
Viewing rulesets for a repository
Anyone with read access to a repository can view the rulesets targeting the repository. This can be useful if you want to know why you can't commit to a branch. On the "Rulesets" page, you can view the active rulesets targeting a certain branch or tag.
-
On GitHub.com, navigate to the main page of the repository.
-
From the file tree view on the left, select the branch dropdown menu, then click View all branches. You can also find the branch dropdown menu at the top of the integrated file editor.
-
To the left of the branch, click .
-
Optionally, to view the rulesets for another branch or tag, use the branch selector dropdown menu.
-
Click the name of the ruleset you want to view.
Editing a ruleset
You can edit a ruleset to change parts of the ruleset, such as the name, bypass permissions, or rules. You can also edit a ruleset to change its status, such as if you want to enable or temporarily disable a ruleset.
-
On GitHub.com, navigate to the main page of the repository.
-
Under your repository name, click Settings. If you cannot see the "Settings" tab, select the dropdown menu, then click Settings.
-
In the left sidebar, under "Code and automation," click Rules, then click Rulesets.
-
On the "Rulesets" page, click the name of the ruleset you want to edit.
-
Change the ruleset as required. For information on the available rules, see "Available rules for rulesets."
-
At the bottom of the page, click Save changes.
Deleting a ruleset
Tip: If you want to temporarily disable a ruleset but do not want to delete it, you can set the ruleset's status to "Disabled." For more information, see "Editing a ruleset."
-
On GitHub.com, navigate to the main page of the repository.
-
Under your repository name, click Settings. If you cannot see the "Settings" tab, select the dropdown menu, then click Settings.
-
In the left sidebar, under "Code and automation," click Rules, then click Rulesets.
-
Click the name of the ruleset you want to delete.
-
To the right of the ruleset's name, select , then click Delete ruleset.