[英]Getting "command not found" error message when running "git log" on Windows
I have installed git and all the commands work properly except git log
.我已经安装了 git 并且所有命令都可以正常工作,除了git log
。 When I type git log
, this message appears:当我输入git log
时,会出现以下消息:
command not found
what could be the possible reason for such a strange behaviour?这种奇怪行为的可能原因是什么?
$ git --version
git version 2.16.1.windows.4
$ which git
/mingx64/bin/git
I just found the solution and wanted to share it with those who may come across the same error.我刚刚找到了解决方案,并想与可能遇到相同错误的人分享。 It seems git log
uses PAGER to show the messages and what I did was to use the git config --global core.pager ''
command to stop git from using PAGER.似乎git log
使用 PAGER 来显示消息,而我所做的是使用git config --global core.pager ''
命令来阻止 git 使用 PAGER。
I've encountered this issue (or something similar to it).我遇到过这个问题(或类似的问题)。
Check inside your git config file, which you can find by running git config --list --show-origin
检查您的 git 配置文件,您可以通过运行git config --list --show-origin
找到该文件
Check to see if you have any properties appended to that file that look incorrect.检查您是否有任何看起来不正确的属性附加到该文件。
For my issue, I had:对于我的问题,我有:
[core]
fsmonitor ==
Which was incorrectly setting a git property to an inappropriate value, causing the output to be: =: =: command not found
哪个错误地将 git 属性设置为不适当的值,导致输出为: =: =: command not found
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.