跟踪大型二进制文件时,git非常慢 [英] git is very very slow when tracking large binary files

查看:160
本文介绍了跟踪大型二进制文件时,git非常慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的项目是六个月大,git非常慢。我们跟踪30个大小为5 MB到50 MB的文件。那些是二进制文件,我们把它们保存在git中。我相信这些文件会让git变慢。

有没有办法从存储库中清除大小大于5MB的所有文件。我知道我会失去所有这些文件,这对我来说没问题。



理想情况下,我想要一个列出所有大文件(> 5MB)的命令。我可以看到列表,然后我说好吧继续前进,删除这些文件,并使git更快。



我应该提到git不仅在我的机器上很慢,而且正在部署分段环境应用程序现在需要大约3个小时。



所以修复应该是会影响服务器的,而不仅仅是存储库的用户。 解决方案

你垃圾收集?

  git gc 



即使是小回购,这也会带来显着的速度差异。

My project is six months old and git is very very slow. We track around 30 files which are of size 5 MB to 50 MB. Those are binary files and we keep them in git. I believe those files are making git slow.

Is there a way to kill all files of size > 5MB from the repository. I know I would lose all of these files and that is okay with me.

Ideally I would like a command that would list all the big files ( > 5MB) . I can see the list and then I say okay go ahead and delete those files and make git faster.

I should mention that git is slow not only on my machine but deploying the app on staging environment is now taking around 3 hours.

So the fix should be something that will affect the server and not only the users of repository.

解决方案

Do you garbage collect?

git gc

This makes a significant difference in speed, even for small repos.

这篇关于跟踪大型二进制文件时,git非常慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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