gh pr diff
See the changes of a pull request
What it does
gh pr diff prints all the changes of a pull request in git diff format without switching branches. With no number, the current branch's PR.
--name-only leaves just the list of changed files: a quick way to see what is touched. The output can go on through a pipe, into grep for instance.
Syntax
gh pr diff <number>
gh pr diff <number> --name-onlyExamples
See the changes in pull request 42
gh pr diff 42pr diff— the PR's changes, like git diff42— the pull request number
Related commands
- git diff — See exactly what changed in your files, line by line
- gh pr checkout — Fetch a pull request's branch and switch to it
- gh pr review — Approve a pull request or ask for changes