GH-RULESET-CHECK(1)

πŸ‘‘ GH-RULESET-CHECK(1) β€” the ruleset check glow-up ✨

okay bestie, welcome to gh-ruleset-check from the GitHub CLI manual, and honestly? this little command is lowkey iconic πŸ’… let's get into it.


🌸 NAME 🌸

gh-ruleset-check β€” peek at the rules that would apply to a given branch πŸ‘€


πŸ¦‹ SYNOPSIS πŸ¦‹

gh ruleset check [<branch>] [flags]

πŸ’– DESCRIPTION πŸ’–

So here's the vibe: you get to view info about the GitHub rules that apply to a given branch. That's it, that's the whole serve ✨

And the best part? The branch name you pass in doesn't even have to exist. fr fr β€” rules will still be displayed that would apply to a branch with that name. And every rule comes back regardless of where it's configured 🫢

If you don't hand over a branch name at all, then it just uses the current branch. main character energy, honestly πŸŽ€

Oh, and if you wanna check the rules on the default branch? That's what the --default flag is for πŸ‘‘


πŸŽ€ OPTIONS πŸŽ€

  • --default β€” check the rules on the default branch πŸ’«
  • -w, --web β€” open the branch rules page in a web browser 🌈 (yes, we're going outside the terminal, shocking i know)

🧚 OPTIONS INHERITED FROM PARENT COMMANDS 🧚

  • -R, --repo <[HOST/]OWNER/REPO> β€” select another repository using the [HOST/]OWNER/REPO format πŸ”

⭐ EXIT CODES ⭐

the receipts, in order πŸ’€

  • 0: successful execution β€” slay, it worked ✨
  • 1: error β€” something went sideways 😭
  • 2: command canceled β€” nvm bestie, we're aborting πŸ™ˆ
  • 4: authentication required β€” you gotta log in first, no cap πŸ”
NOTE: specific commands may have additional exit codes. refer to the command's help for more information β€” iykyk πŸ“–

πŸ”₯ EXAMPLE πŸ”₯

# View all rules that apply to the current branch
$ gh ruleset check

# View all rules that apply to a branch named "my-branch" in a different repository
$ gh ruleset check my-branch --repo owner/repo

# View all rules that apply to the default branch in a different repository
$ gh ruleset check --default --repo owner/repo

# View a ruleset configured in a different repository or any of its parents
$ gh ruleset view 23 --repo owner/repo

# View an organization-level ruleset
$ gh ruleset view 23 --org my-org

🌸 SEE ALSO 🌸


πŸ’œ mwah, that's a wrap! brought to you by GitHub CLI v2.102.0, dated Oct 2026 β€” take care of yourself and your branches, bestie 🫢✨
πŸ“¦ where this page comes from