Command referencegh pr review
gh pr review command (Linux & Windows / GitHub CLI)
What it does
Submit an approve, request-changes, or comment review on a pull request. When people search for gh pr review, they usually want practical GitHub CLI flags, safe examples, and how this subcommand fits everyday PR and repo workflows on Linux, Windows, and macOS. Syntax, options, and copyable examples are below.
Submit an approve, request-changes, or comment review on a pull request.
Syntax
gh pr review [<number> | <url> | <branch>] [flags]
Common options
| Flag / option | Meaning |
|---|---|
| -a, --approve | Submit an approving review. |
| -r, --request-changes | Submit a request-changes review. |
| -c, --comment | Submit a general comment review. |
| -b, --body | Review comment body. |
Practical examples
Approve
gh pr review 123 --approve --body "LGTM"
Approves PR 123 with a short note.
Request changes
gh pr review 123 --request-changes --body "Please add tests."
Blocks merge until the author addresses feedback.
Comment only
gh pr review --comment --body "Nit: rename helper."
Leaves a non-blocking review on the current branch PR.
Common mistakes
- Approving without reading the diff or CI status.
- Combining multiple of `--approve`, `--request-changes`, and `--comment` incorrectly.
Related commands
- gh pr diffShow the diff for a pull request in the terminal.
- gh pr checkoutCheck out a pull request locally as a branch so you can build, test, or review the changes.
- gh pr mergeMerge a pull request using merge commit, squash, or rebase strategies.
- gh pr viewDisplay pull request metadata, body, and checks in the terminal or browser.
- gh auth loginAuthenticate the GitHub CLI with GitHub.com or GitHub Enterprise so other gh commands can run.
- gh pr createCreate a pull request from the current branch with title, body, reviewers, and base branch options.
- gitTrack source history and collaborate through distributed repositories.
- gh repo cloneClone a GitHub repository to your machine using your authenticated gh settings.
FAQ
What does gh pr review do in GitHub CLI?
Submit an approve, request-changes, or comment review on a pull request.
Does gh pr review work on Windows and Linux?
Yes. The GitHub CLI (`gh`) runs on Linux, Windows, and macOS with the same subcommand syntax after you authenticate with `gh auth login`.
What is a practical gh pr review example?
Try `gh pr review 123 --approve --body "LGTM"` — Approves PR 123 with a short note.
Do I need a token in the command line for gh pr review?
Prefer `gh auth login` so credentials stay in the system keyring or secure storage. Avoid pasting personal access tokens into shell history.
Browse the full Linux and Windows command reference to search more bash, CMD, PowerShell, Conda, and GitHub CLI commands.