Created
July 2, 2018 01:14
-
-
Save CodingPapi/e1d248ea807771c7d54136377c5aa84e to your computer and use it in GitHub Desktop.
How to keep git log and less output on the screen
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
How to keep git log and less output on the screen | |
When git uses less as pager the output of commands like git log disappears from the console screen when you exit from less. This is not convenient in many cases so here is how to fix this. | |
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