Git Bash在Windows 7 x64上非常慢 [英] Git Bash is extremely slow on Windows 7 x64

查看:519
本文介绍了Git Bash在Windows 7 x64上非常慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在开发一个小项目期间,我一直在Windows和Ubuntu上使用Git,经常在两者之间来回切换.问题是 Git Bash 持续变慢.

I've been using Git on both Windows and Ubuntu during the development of a small project, frequently flipping back and forth between the two. The issue is that Git Bash consistently becomes slow.

当我说慢时,我的意思是运行cd花费8-25秒,运行git命令花费5-20秒,而ls有时花费30秒.不用说,这不好玩,更不用说徒劳了.我知道Git在Windows上速度较慢,但​​这很荒谬.

When I say slow, I mean that running cd takes anywhere from 8-25 seconds, running git commands take from 5-20 seconds, and ls can take up to 30 seconds sometimes. Needless to say, this is not fun, not to mention unproductive. I know Git is slower on Windows, but this is ridiculous.

一种对我有效的解决方案是暂时禁用我的网络连接(如

The one solution which has worked--temporarily--for me has been to disable my network connection (as suggested in this answer), start Git Bash, and then reconnect. Sometimes it continues to run quickly for days after doing that, but the performance always degrades eventually. I've trawled through the msysgit discussion group, Stack Overflow, msysgit issue list, etc. on and off for weeks, but I haven't been able to turn up solutions which work.

到目前为止,我已经尝试过:

So far, I've tried:

  • 添加Git&项目文件夹添加到病毒扫描程序的排除列表中
  • 完全禁用我的病毒扫描程序(Kaspersky IS 2011)
  • 确保Outlook未运行(Outlook 2007)
  • 关闭所有其他应用程序
  • 以管理员身份运行Git Bash
  • 禁用网络连接,启动Git Bash,并保持连接禁用
  • 禁用网络连接,启动Git Bash,重新启用连接(仅偶尔起作用)
  • 正在运行git gc
  • 以及以上各项的组合
  • Adding Git & project folders to the virus scanner's exclusion list
  • Disabling my virus scanner completely (Kaspersky IS 2011)
  • Ensuring that Outlook is not running (Outlook 2007)
  • Shutting down all other applications
  • Running Git Bash as administrator
  • Disabling network connection, starting Git Bash, and keeping connection disabled
  • Disabling network connection, starting Git Bash, re-enabling connection (works only occasionally)
  • Running git gc
  • And combinations of the above

我确实读过一些人在禁用Bash完成方面取得了成功,但理想情况下,我希望保持这种状态. msysgit的版本是1.7.3.1-preview20101002&操作系统是Windows 7 x64.可以预见,在Linux上运行相同的操作很快.我将只使用Linux,但是我也需要在Windows中运行某些东西(某些应用程序,测试等).

I did read that a couple of people had success disabling Bash completion, but ideally I'd like to keep that active. The version of msysgit is 1.7.3.1-preview20101002 & the OS is Windows 7 x64. Running the same things on Linux is, predictably, lightning fast. I would use Linux exclusively, but I need to run stuff in Windows, too (certain applications, testing, etc.).

有人遇到过类似的问题吗?如果是这样,那么潜在的问题是什么,解决方案(如果有)是什么?

Has anyone encountered a similar issue? If so, what was the underlying problem and what was the solution (if any)?

这不仅限于Git信息库,但仅供参考,我一直在使用Git的信息库很小:最多约4-50个文件.

This extends beyond just the Git repositories, but just for reference, the repositories I've been using Git with have been pretty small: ~4-50 files maximum.

推荐答案

看来,完全卸载Git,重新启动(经典的Windows修复程序)和重新安装Git就是解决方案.我还清除了所有剩余的bash配置文件(它们是手动创建的).一切很快.

It appears that completely uninstalling Git, restarting (the classic Windows cure), and reinstalling Git was the cure. I also wiped out all bash config files which were left over (they were manually created). Everything is fast again.

如果由于某种原因无法(或不希望进行)重新安装,那么我肯定会尝试更改 Chris Dolan's中引用的PS1变量答案;从而导致某些操作的速度大大提高.

If for some reason reinstalling isn't possible (or desirable), then I would definitely try changing the PS1 variable referenced in Chris Dolan's answer; it resulted in significant speedups in certain operations.

这篇关于Git Bash在Windows 7 x64上非常慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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