git diff --pager=<pager>
This command displays the differences between your working tree and index while explicitly choosing which pager program is used to scroll through the output, which is useful when the default pager is inconvenient or when you want a specific viewing experience like color support or better navigation.
This command runs the standard git diff to show line-by-line changes but adds the --pager=<pager> option to tell Git exactly which pager program to invoke instead of the configured default; for example, --pager=less will pipe the diff through less, and --pager=cat will effectively disable paging by just printing directly to the terminal. The --pager=<pager> flag can also take arguments to the pager, such as --pager='less -FRSX' to avoid clearing the screen and to keep long lines unwrapped. You can also use shorter or longer variants of related flags for controlling paging globally, like -c core.pager=<pager> for a one-off config-based pager, or set core.pager in your config to apply the same idea permanently, but they all ultimately control the same pager behavior.
Beyond this specific form, you can combine the same idea with other git diff options such as git diff --cached --pager=<pager> to see staged changes using a custom pager, or git diff HEAD --pager=<pager> to compare your current working tree against the last commit with a specific pager. Closely related commands include setting the global pager with git config --global core.pager <pager>, temporarily disabling paging with git --no-pager diff, or forcing paging for other subcommands like git log --pager=<pager> to get consistent navigation across different Git outputs.
Examples:
git diff --pager=lessgit diff --pager='less -FRSX'git diff --pager=cat