Git的sh.exe过程在Windows XP分叉问题,慢? [英] Git sh.exe process forking issue on windows XP, slow?

查看:288
本文介绍了Git的sh.exe过程在Windows XP分叉问题,慢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Git是我的工作流程是必不可少的。我在我的四核机3GB内存上运行的Windows XP MSYS的Git,通常它反应灵敏,比比。

Git is essential to my workflow. I run MSYS Git on Windows XP on my quad core machine with 3GB of RAM, and normally it is responsive and zippy.

突然,一个问题也随之而来,因此它需要> 30秒,从运行的Git Bash的任何命令命令提示符下,包括 LS CD 。有趣的是,从bash提示符,它看起来喜欢 LS 运行相当快,然后我就可以看到 LS输出,但它然后采取〜30秒的提示返回。如果我切换到Windows命令提示符(由 CMD 从开始菜单中运行)的git相关命令需要天长地久,甚至只是运行。例如 git的状态什么事情发生之前,可以采取接近一分钟。有时候,过程根本就没有完成。

Suddenly an issue has cropped up whereby it takes >30 seconds to run any command from the Git Bash command prompt, including ls or cd. Interestingly, from the bash prompt it looks likes ls runs fairly quickly, I can then see the output from ls, but it then takes ~30 seconds for the prompt to return. If I switch to the windows command prompt (by running cmd from the start menu) git related commands also take forever, even just to run. For example git status can take close to a minute before anything happens. Sometimes the processes simply don't finish.

请注意,我有MSYS的Git安装以及定期的MSYS的东西像的MinGW 制作

Note that I have "MSYS Git" installed as well as regular "MSYS" for things like MinGW and make.

我相信问题是关系到 sh.exe 位于 C:\\ Program Files文件\\的Git \\ BIN 。当我运行 LS 从bash提示符,或者当我调用混帐从窗口提示,任务管理器显示,高达来来去去 sh.exe 进程的四个实例。

I believe the problem is related to sh.exe located in C:\Program Files\Git\bin. When I run ls from the bash prompt, or when I invoke git from the windows prompt, task manager shows up to four instances of sh.exe processes that come and go.

我在这里等待 LS 返回,你可以看到任务管理器具有 git.exe 运行,的四个实例 sh.exe

Here I am waiting for ls to return and you can see the task manager has git.exe running and four instances of sh.exe:

如果我 CTRL-C LS 中间我有时会收到错误,其中包括:

If I ctrl-c in the middle of an ls I sometimes get errors that include:

sh.exe": fork: Resource temporarily unavailable
      0 [main] sh.exe" 1624 proc_subproc: Couldn't duplicate my handle<0x6FC> fo
r pid 6052, Win32 error 5
sh.exe": fork: Resource temporarily unavailable

或者为 git的状态
$ git的状态

Or for git status: $ git status

sh.exe": fork: Resource temporarily unavailable
sh.exe": fork: Resource temporarily unavailable
sh.exe": fork: Resource temporarily unavailable
sh.exe": fork: Resource temporarily unavailable

我可以解决这个问题,这样混帐迅速再次运行,如果又如何?

东西我曾尝试:


  • 重新启动

  • 升级MSYS的Git到最新版本和放大器;重新启动

  • 升级到MSYS最新版本和放大器;重新启动

  • 卸载MSYS&安培;卸载并单独与放大器重新安装MSYS的Git;重新启动

我倒是非常想不抹我的盒子并重新安装Windows,但我会,如果我不能得到这个固定。我不能再code。如果需要我> 30秒运行 git的状态 CD

I'd very much like to not wipe my box and reinstall Windows, but I will if I can't get this fixed. I can no longer code if it takes me >30 s to run git status or cd.

推荐答案

通常,当一个程序需要30秒做一些事情,应该是瞬间的,它更可能是一个I / O超时问题,通常的网络,而不是你的CPU速度,或者您的RAM数量。你可能想知道网络是如何参与其中,但是这是一个合理的问题(我不知道你的系统其一)。

Usually when a program takes 30 seconds to do something that should be instantaneous, it's more likely to be an I/O timeout problem, usually network, rather than the speed of your CPU or the amount of RAM you have. You may wonder how the network is involved, but that's a legitimate question (I wouldn't know for your system either).

Msysgit安装运行一个特殊功能 __ git_ps1 显示在提示一些有用的信息的特殊提示。你可以看到这一点使用回声$ PS1 ,我的系统这说明:

Msysgit installs a special prompt that runs a special function __git_ps1 that shows some useful information in the prompt. You can see this using echo $PS1, for my system this shows:

$ echo $PS1
\[\033]0;$MSYSTEM:\w\007 \033[32m\]\u@\h \[\033[33m\w$(__git_ps1)\033[0m\] $

这额外的信息是完全可​​选的,您可以将其关闭。因此,尝试在Msysgit窗口如下:

This extra information is totally optional and you can turn it off. So try the following in an Msysgit window:

$ PS1='$ '
$

这将提示重新设置为默认 $ ,而不是试图运行,并提示里面的命令。如果这解决您的延迟问题,那么很可能是 __ git_ps1 功能。尝试手动运行它:

This will reset the prompt to the default $ and not try to run and commands inside the prompt. If this solves your delay problem, then it's likely to be the __git_ps1 function. Try running it manually:

$ __git_ps1
 (master)

,看看需要多长时间恢复。

and see how long it takes to return.

您可以通过删除调用 __ git_ps1 C中的行解决这个问题C>:

You can fix this by removing the line that invokes __git_ps1 from C:\Program Files\Git\etc\profile:

#Comment the lines below
#PS1='\[\033]0;$MSYSTEM:\w\007
#\033[32m\]\u@\h \[\033[33m\w$(__git_ps1)\033[0m\]
#$ '

这篇关于Git的sh.exe过程在Windows XP分叉问题,慢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆