Git pull 很慢...为什么? [英] Git pull is very slow... Why?

查看:105
本文介绍了Git pull 很慢...为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

注意我已经研究了 git-is-very-very-slow 问题,但在他们的情况下,原因是大的二进制文件 - 而在我的存储库中只有 PHP/JS/HTML/CSS 代码(没有二进制文件),并且存储库中的最大文件大约为 800 KB.

Note I have studied the git-is-very-very-slow question, but in their case the reason was big binary files - while in my repository there is PHP/JS/HTML/CSS only code (no binaries) and the biggest file in the repository is around 800 KB.

我已经更改了一个文件(几行),然后是 git add .git commit -m "msg",然后是 git push origin大师.

I've changed one file (a few lines), then git add . and git commit -m "msg", then git push origin master.

在其他一些机器上,当我执行 git pull origin master 时,它会下载几 MiB 的数据,计算增量和应用更改需要 2 多分钟.这里出了点问题.

On some other machine, when I do git pull origin master it downloads a few MiB of data, and it takes more than 2 minutes to calculate the delta and apply changes. Something is terribly wrong here.

我怀疑最近的一些操作可能会导致这种情况:

I suspect some recent operations may cause this:

最近,我不小心添加了许多供应商资产(bower_components 资产)当我意识到这一点时,我已经使用 git rm 从存储库中删除它们(当然还有 git addgit commitgit push 到上游).

recently, I've accidentally added many vendor assets (bower_components assets) when I realized it, I've used git rm to remove them from repository (and ofcourse, git add, git commit and git push to upstream).

那是几天前的事了,我现在的问题在那个时候开始出现.

That was a few days ago and the problems I have right now started happeing around that time.

我有两个问题:

  • 为什么会这样?
  • 如何修复我的存储库?

注意:我是唯一一个使用并推送到这个 repo 的人.

Note: I am the only one useing and pushing to this repo.

推荐答案

问题出在 EmberJS 应用程序目录中.它包含 node_modulesbower_components 目录,这些目录保存了 GruntJS 用来构建我的 JS 和 CSS 资产的第三方库.

The problem was in EmberJS app directory. It contained node_modules and bower_components directories which kept third-party libraries used by GruntJS to build my JS and CSS assets.

每个都包含许多文件和目录..考虑到依赖关系树包含数百个大小不等的库,从小(几个文件)到大(很多文件)不等.

Each of these contained many files and directories.. considering that the dependency tree contained hundreds of libraries of size varying from small (few files) to big fat (many files).

删除这些目录并忽略它们后,git 存储库再次快速运行.

After removing these directories and ignoring them, the git repository works fast again.

这篇关于Git pull 很慢...为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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