gh pr view

View a pull request in the browser

Synopsis

View a pull request specified by the argument in the browser.

Without an argument, the pull request that belongs to the current branch is opened.

gh pr view [{<number> | <url> | <branch>}] [flags]

Options

  -p, --preview   Display preview of pull request content

Options inherited from parent commands

      --help              Show help for command
  -R, --repo OWNER/REPO   Select another repository using the OWNER/REPO format

Examples in use

In the browser

Quickly open a pull request or issue in the browser.

# Viewing a pull request in the browser
~/Projects/my-project$ gh pr view 21
Opening https://github.com/owner/repo/pull/21 in your browser.
~/Projects/my-project$

In terminal

Use --preview or -p to view a preview of the title and body.

# Viewing a pull request in terminal
~/Projects/my-project$ gh pr view 21 --preview
Hide PR number badges on branches that have an upstream PR
opened by user. 0 comments. (enhancement)

  While we're in a state where we're not displaying upstream pull requests in the PR list, we should
  hide the `#XX` badge to avoid confusion.

View this pull request on GitHub: https://github.com/owner/repo/pull/21
~/Projects/my-project$