I am a new user of Git for Windows. I have installed from Google Code (1.8.1.2, and 1.7 as a trial).
I can issue some git commands, and they are fine and work perfectly. However, the 'git diff' and 'git log' commands do not work. These commands both come back with
'': : command not found
I have tried uninstalling and re-installing. I also have GitHub for Windows on my machine. The machine is Windows 7, very new build.
Could anyone help or give me diagnostic pointers as to why these two commands fail?
It sounds like your .gitconfig file might not be setup correctly, or the environmental PATH is missing.
For folks that are new to git I almost always recommend that they first start with either
Git Hub for Windows (easiest for new folks)
or
Git Extensions (not sure if this is what you installed)
In .gitconfig, the pager value was an empty string. Any git command that pipes to a pager (ie git-diff or git-log) will fail with a command-not-found because DOS is being asked to run an empty string as a command. No idea how it happened.
Path too big to paste
Make sure your PATH is not too big or it might end up truncated, with strange side-effects (like, potentially, your error messages)
Try and launch git-cmd.bat
, or the git-bash
shortcut, both included in the msysgit distribution.
They will complement the PATH and set HOME
(which is very important, since Windows doesn't set HOME
by default)
In those sessions (git-cmd
or bash
), git diff
should work.
The actual solution was like the one in "msysGit: Why does git log output blank lines?": set the pager
[core]
pager = less -R
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With