Always use the pager for git diff

I'm using less as my git pager.

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?

Doesn't work:

  • git -p diff
  • git --paginate diff
  • git settings: pager.diff = true


This is controlled by the -F (--quit-if-one-screen) option to less.

Git uses the options FRSX for/of less by default, if none are specified by the $LESS or $GIT_PAGER environment variables. To change it, specify the core.pager option and set it to RSX:

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'

Need Your Help

how to change cookie to session?

php session cookies

I'm new to session and cookie. Like the tile I want to change cookie to session. I just get code from the link here:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.