Git Windows 命令提示符在使用 (END) 的 Git 命令期间卡住
我已经安装了适用于 Windows 的 Git (msysgit),过去几天它工作正常,今天我遇到了一个奇怪的错误。
在 Windows 命令提示符或与 msysgit 捆绑在一起的 Git Bash 中发出 Git 命令时,出现奇怪的“(END)”行,然后我无法发出任何其他命令。
此时我听到的只是系统蜂鸣声。
有什么想法吗?
谢谢,P。
I've got Git for Windows setup (msysgit) and it was working fine for the last few days and today I've encountered an odd error.
When issuing a Git command in the Windows Command Prompt or in the Git Bash that comes bundled with msysgit, I get a strange '(END)' line appear and then I cannot issue any other comamnds.
At this point all I get are system beeps.
Any ideas?
Thanks, P.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
Git 想要向你显示多屏信息,为此它调用了标准的 Unix 分页程序
less
。当您不想再在输出中导航时,只需键入 q 即可返回到提示符。如果你想有效地使用 git,你应该学习基本的 UNIX 工具。即使 git 在 Windows 上构建和运行,它在该平台上也几乎是一个陌生的软件。
如果您不想要
less
,只需将其替换为配置中的另一个寻呼机即可。如果您根本不需要寻呼机,只需使用cat
:Git want to show more than one screen of information to you, to do so it call the standard unix pager program
less
. Just type q to return to the prompt when you no longer want to navigate in the output.If you want to use git efficiently you should learn the basic unix tools. Even if git build and run on windows it's pretty much an alien software on the platform.
If you don't want
less
just replace it with another pager in the configuration. If you don't want a pager at all just usecat
:按q退出寻呼机(即
less
)。Press q to exit the pager (which is
less
in git by default).当我在寻找同样的东西时,我第一次遇到这个问题;不必退出日志命令。我已经找到了我喜欢的答案,所以即使在最初的询问之后很久,我也会添加这个答案,以提供我在自己的搜索中没有很快找到的额外解决方案。
其他人已经说明了为什么存在
(END)
——结果通过寻呼机传送,可以为不同的寻呼机进行配置。然而,有时我根本不想让它停止;因为我已经指定了其他选项来进行限制。我发现对于这个 git 有一个全局选项
--no-pager< /code> 关闭配置文件中定义的任何寻呼机。
这个全局选项位于 git 命令本身,可用于所有子命令,并放置在子命令之前,如下所示:
I first came across this question when I was looking for the same thing; to not have to exit out of the log command. I have since found the answer I like, so even though it is well after the original asking I will add this answer to provide an additional solution that I didn't find quickly in my own search.
Others have stated why the
(END)
is present -- the results are being piped thru a pager, one that can be configured for a different pager.However, I sometimes don't want it to stop at all; because I've specified other options that do the limiting. I found that for this git has a global option
--no-pager
to turn off the whatever pager is defined in the config file.This global option is on the
git
command itself, is available for all subcommands and is placed before the subcommand like this:Git 使用名为
less
的“分页器”,它允许您轻松地滚动浏览大量程序输出。然而,Windows 版 Git 的默认设置似乎是即使输出少于一屏也保持分页器运行。这是我之前的默认设置,它始终显示
(END)
并等待您点击q
然后返回提示:您可以更改行为这样,通过将选项更改为
-F
而不是,当输出超过一屏时,
。less
才会继续运行(并控制键盘) -+F修复讨厌的寻呼机
(less的
-+X
选项语法被记录为将-X
选项重置为其“默认”,尽管这不是我在-+F
中观察到的行为,因为完全删除该选项相当于-F
,而不是-+F
。)Git is using the "pager" called
less
, which allows you to scroll through large amount of program output easily. However, the default settings on Git for Windows seem to be to keep the pager running even when there is less than one screen of output.Here is the default setting I had before, which would always show the
(END)
and wait for you to hitq
before returning you to your prompt:You can change the behavior so that
less
will only keep running (and take control of the keyboard) when there is more than a screenful of output by changing the option to-F
instead of-+F
.Fix the pesky pager with
(The
-+X
option syntax for less is documented to reset the-X
option to its "default", although that is not the behavior I observed with-+F
since removing the option altogether was equivalent to-F
, not-+F
.)