Git Log Displays Nothing
git log
does not show any commit!
I noticed that not only git log
command but also man
command does not show anything for me.
It turned out that I just needed to set the PAGER
environment variable to less
or more
programs to solve both problems.
export PAGER=less
May be that the pager is not set up correctly with git.
Diagnostics:
git config core.pager
If it gives empty output or something unexpected, it may be the cause of the problem.
Solution
Try one of the following with xxx = more, less or other pager of choice:
git config core.pager xxx
git config --global core.pager xxx
I've just experienced the same problem, of git log not displaying anything for a particular file. The problem turned out to be Windows was displaying the directory name with an upper-case first letter, but git expected the first letter to be lower-case. So "git log Subdir/file.c" produced no errors and no output. Whereas "git log subdir/file.c" produced the expected revision history.