table of contents
| GT-BRANCH-PROTECTION-VIEW(1) | gitea-cli Manual | GT-BRANCH-PROTECTION-VIEW(1) |
NAME¶
gt-branch-protection-view - View a branch protection rule
SYNOPSIS¶
gt branch protection view <rule> [flags]
DESCRIPTION¶
View a protection rule, which requires admin access to the repository. The rule is named as gt branch protection list lists it: a branch, or the pattern that was protected, such as release/*.
ARGUMENTS¶
A repository can be supplied as NAME (one of yours), OWNER/NAME, HOST/OWNER/NAME or a URL. Without an argument, the repository of the current Git clone is used.
JSON FIELDS¶
approval_teams, approval_users, approvals_restricted, block_admin_merge_override, block_on_official_review_requests, block_on_outdated_branch, block_on_rejected_reviews, created_at, dismiss_stale_approvals, force_push, force_push_deploy_keys, force_push_restricted, force_push_teams, force_push_users, ignore_stale_approvals, merge_restricted, merge_teams, merge_users, protected_file_patterns, push_deploy_keys, push_enabled, push_restricted, push_teams, push_users, require_signed_commits, required_approvals, rule, status_check_required, status_checks, unprotected_file_patterns, updated_at
OPTIONS¶
-h, --help[=false] help for view
OPTIONS INHERITED FROM PARENT COMMANDS¶
--csv[=""] Output CSV with the specified comma-separated fields, or all fields
--cwd="" Working directory for repository discovery
--debug[=false] Log the method, URL, status, and duration of each HTTP request to stderr
--host="" Gitea instance URL, including any base path
--interactive[=false] Allow prompts with machine output
-q, --jq="" Filter JSON output using a jq expression; implies --json
--json[=""] Output JSON with the specified comma-separated fields, or all fields
--no-input[=false] Disable prompts and implicit editor/browser interactions
--remote="" Git remote used for repository discovery
-R, --repo="" Select a repository as OWNER/REPO or URL
--sudo="" Perform API requests as this user (requires an administrator account)
--template="" Format JSON output using a Go template; implies --json (see gt help formatting)
--user="" Account name on the selected instance
EXAMPLE¶
$ gt branch protection view main $ gt branch protection view 'release/*' --json push_users,push_teams
SEE ALSO¶
| Nov 2026 | gitea-cli |