The text mentions core.pager and GIT_PAGER without giving the overall picture of precedence. See commit 97d01f2a for the reason behind the new documentation wording: config: rewrite core.pager documentation
![macos git diff not less macos git diff not less](https://miro.medium.com/max/854/1*zejqB99KHo0huYN3etCYGA.png)
The environment tells the command to set the S option to chop long lines but the command line resets it to the default to fold long lines.
![macos git diff not less macos git diff not less](https://miro.medium.com/max/1400/1*osPG5-k5T7lfqi_uGK40_g.png)
This will be passed to the shell by Git, which will translate the final command to LESS=FRSX less -+S. If you want to selectively override Git's default setting for LESS, you can set core.pager to e.g. (if LESS environment variable is set, Git does not change it at all). When the LESS environment variable is unset, Git sets it to FRSX and then the default chosen at compile time (usually 'less').The value is meant to be interpreted by the shell. Text viewer for use by Git commands (e.g., 'less'). Those modifications were already visible in git 1.8.x, as illustrated in " Always use the pager for git diff" (see the comments).īut the documentation just got reworded ( for git 1.8.5 or 1.9, Q4 2013). Less supports horizontal scrolling, so when lines are chopped off, less disables quit-if-one-screen so that the user can still scroll the text to the left to see what was cut off. Wilson F mentions in the comments and in his question that: So that I get colored diff with Ctrl-C quit from less.
![macos git diff not less macos git diff not less](https://miro.medium.com/max/854/1*TCLA3In0FcH_uPFp8vTqIw.png)
The recent changes in the documentation mention a different way of removing a default option for less ("default options" being FRSX).įor this question, this would be (git 1.8+) git config -global -replace-all core.pager 'less -+F -+X'įor example, Dirk Bester suggests in the comments: export LESS="$LESS -FRXK"