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/REPOformat π
β 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 πΈ
gh-ruleset(1)β the whole ruleset fam, go say hi π¦
π 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
- opensuse-leap 16.0: gh 2.102.0-bp160.1.1 Β· MIT
- opensuse-leap 16.0: gh 2.102.0-bp160.1.1 Β· MIT
- opensuse-leap 16.0: gh 2.102.0-bp160.1.1 Β· MIT
- opensuse-leap 16.0: gh 2.102.0-bp160.1.1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms