简体   繁体   English

在 Windows 上运行“git log”时收到“找不到命令”错误消息

[英]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.

相关问题 作为Windows服务运行的命令行应用程序。 出现错误1053 - Command line application running as a windows service. Getting error 1053 bash:nano:在Windows git bash中找不到命令 - bash: nano: command not found at Windows git bash MSYS2:集成 Git-For-Windows 后,我在 MSYS2 启动时收到此错误:bash: create-shortcut.exe: command not found - MSYS2: After integrating Git-For-Windows, I'm getting this error at MSYS2 startup: bash: create-shortcut.exe: command not found Git 挂起在 Windows 上运行任何命令 10 - Git Hangs Running Any Command on Windows 10 “触摸”命令拼写错误或在 windows 上的 git 命令上找不到 - The "touch" command is either mispelled or could not be found on git command on windows Windows 版 Git 中的 Bash:使用 CMD.exe /C 和 args 运行命令时很奇怪 - Bash in Git for Windows: Weirdness when running a command with CMD.exe /C with args Windows 7 上的 git 期望未找到 dev null 错误 - git on windows 7 expecting dev null not found error 在Windows上使用单个命令通过git log获取第一行 - Get first line by git log with a single command on windows 在Windows Azure上运行WCF服务时获取“拒绝访问”异常消息 - Getting 'Access is Denied' exception message when running WCF service on Windows Azure 从Windows上的Git开始,接收sh.exe“:配置:找不到命令 - starting with Git on Windows, receiving sh.exe" : config: command not found
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM