Question

Before, I could just type

git log

Now, I have to type:

git log | less

to get the same effect. I haven't (intentionally) changed any parameters. I've checked my global config: "~/.gitconfig" and my project Git config ".git/config" but I can't see anything that would cause this. All of the command parameters seem to be for opting out of this.

Furthermore, none of these work either:

git config --add --global core.pager less
git log

or

GIT_PAGER=less git log

or

PAGER=less git log
Was it helpful?

Solution

"did you try unplugging it and plugging it back in" I opened a new terminal and it stopped happening. I am still super curious though what in that other window's environment could be causing this, so I'll leave it open for awhile and if anyone has any ideas please let me know :)

OTHER TIPS

There are two parameters that might affect this: the core.pager Git variable, and the $PAGER environment variable. Check what you have with

git config core.pager
echo $PAGER

One of them should be set to less

See the config variable core.pager: "The command that git will use to paginate output. Can be overridden with the GIT_PAGER environment variable."

I figured out the real reason when I had the issue on MSYS. It just needed the full path. e.g.

git config --add --global core.pager /usr/bin/less

(I suppose on Linux it would be similar.)

It's pretty obvious the underlying issue is that a quirk caused git to not be aware of the PATH.

setting git core.pager will ensure log outputs directed to pager:

git config --global core.pager less
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top