GH-PR-DIFF(1)
π gh-pr-diff(1) β the GitHub CLI manual, bestie edition π«Ά
okay so picture this: it's giving "show me what actually changed in this pull request" and honestly? iconic. this is gh-pr-diff, straight out of the GitHub CLI manual, and yes she absolutely ate.
β¨ NAME β¨
gh-pr-diff β view the changes in a pull request, no cap π
πΈ SYNOPSIS πΈ
gh pr diff [<number> | <url> | <branch>] [flags]
π¦ DESCRIPTION π¦
View changes in a pull request. that's the whole vibe, that's the assignment π
If you don't give it an argument, it picks the pull request that belongs to the current branch. so like, it already knows. main character energy fr fr β¨
With the --web flag, it opens the pull request diff in a web browser instead. browser girlies rise π
Use --exclude to filter out files matching a glob pattern. quick note though, bestie: the pattern uses forward slashes as path separators on all platforms. all of them. no exceptions. and you can repeat the flag to exclude multiple patterns, so go off π
okay and this part is important, listen up π«Ά β by default, terminal escape sequences in the diff are neutralized, because they could manipulate your terminal. like, literally could take over your terminal. not cute. so if you want the diff printed verbatim, pass --allow-escape-sequences, for example when you're piping a patch to another program. that's the only time, i'm watching you π
π OPTIONS π
--allow-escape-sequencesβ allow printing terminal escape sequences. yes, the raw ones. you asked for it π--color <string>(default"auto") β use color in diff output:{always|never|auto}-e,--exclude <patterns>β exclude files matching glob patterns from the diff π¦--name-onlyβ display only names of changed files. no contents, just the roster β¨--patchβ display diff in patch format π©Ή-w,--webβ open the pull request diff in the browser π
π OPTIONS INHERITED FROM PARENT COMMANDS π
-R,--repo <[HOST/]OWNER/REPO>β select another repository using the[HOST/]OWNER/REPOformat. inherited from the parent command, so it's like a hand-me-down but make it fashion π
π EXIT CODES π
0: successful execution β slay π1: error β π2: command canceled β nvm bestie4: authentication required β log in, babe π
NOTE: specific commands may have additional exit codes. refer to the command's help for more information. iykyk π§
π EXAMPLE π
# See diff for current branch
$ gh pr diff
# See diff for a specific PR
$ gh pr diff 123
# Exclude files from diff output
$ gh pr diff --exclude '*.yml' --exclude 'generated/*'
# Exclude matching files by name
$ gh pr diff --name-only --exclude '*.generated.*'
like, look at her go. obsessed π
π SEE ALSO π
gh-pr(1)β the parent, the blueprint, the icon
and that's the page !! this one's from GitHub CLI v2.102.0, dated Oct 2026 β mwah, take care of her, and go look at some diffs π β¨
π¦ 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