Reputation: 338
As the GIF above shows, running git log
in my WSL2 Ubuntu suddenly became noninteractive. It would show all the logs at once (while the Windows counterpart seemed to be working fine). git
has already been updated to the latest version, and this behavior is also present when running WSL2 by itself, i.e., not using the Windows Terminal app. Any ideas on what caused the issue? Any help is appreciated. Thanks!
Upvotes: 0
Views: 324
Reputation: 51988
Following the doc for git config core.pager
(from git help config
) :
core.pager
Text viewer for use by Git commands (e.g., less). The value is meant to be interpreted by the shell. The order of preference is the
$GIT_PAGER
environment variable, thencore.pager
configuration, then$PAGER
, and then the default chosen at compile time (usuallyless
).
check the values of :
echo $GIT_PAGER
git config core.pager
echo $PAGER
If the pager is indeed less
, confirm that less
is installed (this is very probably the case: less --version
), and then check the environment variables that affect LESS
:
env | grep LESS
it could be that some of these options turn off the paging of less
.
Finally, if all the values above look like usual values, check if your terminal and tty report correct values (echo $TERM
, I just fished stty size
from this question, etc ...).
Upvotes: 2
Reputation: 30888
It seems no pager is working on your Ubuntu. Try git -c core.pager=more log
or git -c core.pager=less log
. It could still not work if more
or less
is not available. If it works, you can set a global option by
git config --global core.pager less
# or "more", depending on which takes effect
Besides, you can disable the pager temporarily by git --no-pager log
.
Upvotes: 4
Reputation: 419
git log
is supposed to show a list of all the commits to the repository, so it's working as intended see documentation? Maybe you never noticed it before because your repo was smaller? And now you've got so many commits its freezing? Is it only temporary? (your GIF looks like its piping through a tool like less)
If you don't want this, use some command-line arguments to refine what you are doing.
git log -n 1
Shows only the most recent commit. -n 2
shows the two most recent, and so on...
Many of the windows git tools are wrappers for git, so maybe they do extra stuff which would explain differences in behaviour that you've seen
Upvotes: 0