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

查看:46
本文介绍了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.

对我来说暂时有效的一种解决方案是禁用我的网络连接(如 this answer),启动 Git Bash,然后重新连接.有时它会在这样做后继续快速运行数天,但最终性能总是会下降.我已经断断续续地浏览了 msysgit 讨论组、堆栈溢出、msysgit 问题列表等几个星期,但我一直无法找到有效的解决方案.

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
  • 以及以上的组合

我确实读到有几个人成功禁用了 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 中引用的 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天全站免登陆