gh-ruleset - Man Page
View info about repo rulesets
Examples (TL;DR)
- List all rulesets for the current repository:
gh [rs|ruleset] [ls|list] - List all rulesets for a specific organization:
gh [rs|ruleset] [ls|list] [-o|--org] organization_name - Check the rules that apply to the current branch:
gh [rs|ruleset] check - Check the rules that apply to a specific branch in another repository:
gh [rs|ruleset] check branch_name [-R|--repo] owner/repo - Interactively select and view a ruleset for the current repository:
gh [rs|ruleset] view - View a specific ruleset by its ID:
gh [rs|ruleset] view ruleset_id - View an organization-level ruleset by its ID:
gh [rs|ruleset] view ruleset_id [-o|--org] organization_name - Open the list of rulesets for a specific repository in the browser:
gh [rs|ruleset] [ls|list] [-R|--repo] owner/repo [-w|--web]
Synopsis
gh ruleset <command> [flags]
Description
Repository rulesets are a way to define a set of rules that apply to a repository. These commands allow you to view information about them.
Available Commands
- gh-ruleset-check(1)
View rules that would apply to a given branch
- gh-ruleset-list(1)
List rulesets for a repository or organization
- gh-ruleset-view(1)
View information about a ruleset
Options
- -R, --repo <[HOST/]OWNER/REPO>
Select another repository using the [HOST/]OWNER/REPO format
Aliases
gh rs
Exit Codes
0: Successful execution
1: Error
2: Command canceled
4: Authentication required
NOTE: Specific commands may have additional exit codes. Refer to the command's help for more information.
Example
$ gh ruleset list $ gh ruleset view --repo OWNER/REPO --web $ gh ruleset check branch-name
See Also
Referenced By
gh(1), gh-ruleset-check(1), gh-ruleset-list(1), gh-ruleset-view(1).
Nov 2025 GitHub CLI manual