Why do I have to hit 'Q' at the end of 'git log'?

You can "turn off" git paging by telling it to use cat instead of less. Thereafter, pipe the output through less when you do want paging, or head if you just want to see the top, etc.

git config --global core.pager cat

I turn off automatic paging because I often run git from within emacs, which neither needs nor plays well with less.


Git is automatically paging the output for you, since logs tend to easily overflow a single terminal window size (you're in one of the rare exceptions - a oneline format and a small commit limit). If you don't want this, use:

git --no-pager log -n 20 --pretty=oneline

Note that this does mean you'll get some ugly wrapping, because the pager was previously turning off wrapping for you (since you could use the cursor keys to scroll left-right).


less accepts -F argument to quit automatically if content fits on one screen

Tags:

Git