Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CodingPapi/47a6565aea967ddd3e0f95eea1e8f8aa to your computer and use it in GitHub Desktop.
Save CodingPapi/47a6565aea967ddd3e0f95eea1e8f8aa to your computer and use it in GitHub Desktop.
How to keep git log and less output on the screen
http://serebrov.github.io/html/2014-01-04-git-log-and-less-keep-output.html
Just for git commands:
git config --global --replace-all core.pager "less -iXFR"
For less globally (including git) - add to .bashrc / .zshrc / etc:
export LESS=-iXFR
The options we set for less are:
* -i - ignore case when searching (but respect case if search term contains uppercase letters)
* -X - do not clear screen on exit
* -F - exit if text is less then one screen long
* -R - was on by default on my system, something related to colors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment