Git Windows 命令提示符在使用 (END) 的 Git 命令期间卡住

发布于 2024-09-27 17:53:06 字数 277 浏览 6 评论 0原文

我已经安装了适用于 Windows 的 Git (msysgit),过去几天它工作正常,今天我遇到了一个奇怪的错误。

在 Windows 命令提示符或与 msysgit 捆绑在一起的 Git Bash 中发出 Git 命令时,出现奇怪的“(END)”行,然后我无法发出任何其他命令。

alt text

此时我听到的只是系统蜂鸣声。

有什么想法吗?

谢谢,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.

alt text

At this point all I get are system beeps.

Any ideas?

Thanks, P.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

无悔心 2024-10-04 17:53:06

Git 想要向你显示多屏信息,为此它调用了标准的 Unix 分页程序 less。当您不想再在输出中导航时,只需键入 q 即可返回到提示符。

  • j 向下移动一行
  • k 向上移动一行
  • 向下移动一页
  • b 移动一页up
  • h 显示帮助

如果你想有效地使用 git,你应该学习基本的 UNIX 工具。即使 git 在 Windows 上构建和运行,它在该平台上也几乎是一个陌生的软件。

如果您不想要less,只需将其替换为配置中的另一个寻呼机即可。如果您根本不需要寻呼机,只需使用 cat

git config --global --add core.pager 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.

  • j move one line down
  • k move one line up
  • <space> move one page down
  • b move one page up
  • h show the help

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 use cat :

git config --global --add core.pager cat
时光病人 2024-10-04 17:53:06

q退出寻呼机(即less )。

Press q to exit the pager (which is less in git by default).

四叶草在未来唯美盛开 2024-10-04 17:53:06

当我在寻找同样的东西时,我第一次遇到这个问题;不必退出日志命令。我已经找到了我喜欢的答案,所以即使在最初的询问之后很久,我也会添加这个答案,以提供我在自己的搜索中没有很快找到的额外解决方案。

其他人已经说明了为什么存在(END)——结果通过寻呼机传送,可以为不同的寻呼机进行配置。

然而,有时我根本不想让它停止;因为我已经指定了其他选项来进行限制。我发现对于这个 git 有一个全局选项 --no-pager< /code> 关闭配置文件中定义的任何寻呼机。

这个全局选项位于 git 命令本身,可用于所有子命令,并放置在子命令之前,如下所示:

git --no-pager log

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 --no-pager log
计㈡愣 2024-10-04 17:53:06

Git 使用名为 less 的“分页器”,它允许您轻松地滚动浏览大量程序输出。然而,Windows 版 Git 的默认设置似乎是即使输出少于一屏也保持分页器运行

这是我之前的默认设置,它始终显示 (END) 并等待您点击 q 然后返回提示:

$ git config --get core.pager
less -+F

您可以更改行为这样,通过将选项更改为 -F 而不是 ,当输出超过一屏时,less 才会继续运行(并控制键盘) -+F

修复讨厌的寻呼机

$ git config --global core.pager "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 hit q before returning you to your prompt:

$ git config --get core.pager
less -+F

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

$ git config --global core.pager "less -F"

(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.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文