Always use the pager for git diff
less as my
If the git diff output is readable on one page, my git prints the output to the screen.
Sometimes I’m too fast with typing
Ctrl+D (half page down), which kills my terminal. Is there an option to enable the pager for
git diff, even if the output is very small?
- Ignore any blank space or line break in git-diff
- Need to get all file differences (added, modified, renamed) between two Git comits
- is it possible to add a comment to a diff file (unified)?
- What do the green rectangles mean in Qt Creator's diff viewer?
- git diff doesn't show enough
- Diff a staged file with one in stash
git -p diff
git --paginate diff
pager.diff = true
One Solution collect form web for “Always use the pager for git diff”
This is controlled by the
--quit-if-one-screen) option to less.
Git uses the options
FRSX for/of less by default, if none are specified by the
$GIT_PAGER environment variables. To change it, specify the
core.pager option and set it to
git config --global core.pager 'less -+F'
Older versions of Git used to recommend the following in their documentation:
git config --global core.pager 'less -+$LESS -RSX'