Git Log Displays Nothing

Viewed 8612

I have a number of git repositories (with commits) and each displays nothing when running git log. If I run the command outside a project directory (without a git repository) I get:

fatal: Not a git repository (or any of the parent directories): .git

I tried re-installing Git (I'm now running 1.7.5.4) and re-cloning my repositories to no avail. Any ideas?

8 Answers

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 had the similar issue with a log to a file. 1] get a list of your config files git config --list 2] check this entry core.filemode=false change it to true git config core.filemode true 3] check your files path in gitk 4] i had the wrong path. now it works. git log -- ./Documents/holdMe.txt

For those who still don't come up with solution: Check your firewall, mine (Comodo on windows10) was blocking Git\usr\bin\less.exe.

After removing it from blocked apps it worked fine.

Related