从存储库历史中删除大文件后,Git repo仍然很大 [英] Git repo still huge after large files removed from repository history

查看:118
本文介绍了从存储库历史中删除大文件后,Git repo仍然很大的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个代码库(至今)使用git来存储它的依赖关系。资料库本身在这里可用(警告:它很大)。不用说,我需要从版本库历史记录中删除依赖项,以便将其降低到合理的大小。



我通过使用 David Underhill的说明删除 lib 历史记录中的目录。但是,即使在这样做之后,存储库仍然超过300M。发行 git prune git repack 有帮助,但它仍然超过180M。



为了找到任何臃肿的斑点,我发出了

pre> git verify-pack -v .git / objects /pack/pack-*.idx | grep -v链| sort -k3nr |头部

包含以下结果:


'p> 105526b5d3d398b9989d88c2f9fc2d1dc96a85b8团块35685609 33600527 31978828
d296935e6ac5f3f58b50c789394c9769116e9c34团块35658016 33593241 112485744
50636f931180a32764edadd854968a971a083f8a团块28360290 25897864 233390
b9e4dd37428e879a258f297b7f5bcfb9ba869695团块13108002 11640713 66661788
08d2720b2414aa07ce419b17d5f80c333c7313b7团块12551621 11124009 89231035
6197a478a461275a0396f20c28487e9ae619a5f9斑点11975135 11058259 148211988 1 50636f931180a32764edadd854968a971a083f8a
549eb0c73776fd0ede27a2fcb03366f76f45a13c团块9136086 8166649 166451273
5bc0a0f04a7004bc16cfab1c091c6b369fb74049团块9072616 8270262 80951514
741480238a6a6ce612cf089245dd46d6890fba9f团块8858569 8080252 101294029
744226651c55b14c1aa8affb78fba4fdf02b577c团块7412220 6766404 186825167


这是我的地方卡住了。我可以 git show 这些blob,看看它们看起来非常像jar文件,但我无法弄清楚它们为什么还在回购站点。



尝试查找文件名失败。

git repack -a git repack -ad git repack -Ad 似乎都没有效果。

解决方案

你有没有试过运行 git gc http://www.kernel.org/pub/software /scm/git/docs/git-gc.html


I have a codebase that (until now) used git to store its dependencies. The repository itself is available here (warning: it's HUGE). Needless to say, I need to remove the dependencies from the repository history in order to cut it down to a reasonable size.

I started by using David Underhill's instructions to remove the lib directory from the history. Even after doing this, however, the repository is still over 300M. Issuing git prune and git repack helps, but it's still over 180M.

In an attempt to find any bloated blobs, I issued

git verify-pack -v .git/objects/pack/pack-*.idx | grep -v chain | sort -k3nr | head

with these results:

105526b5d3d398b9989d88c2f9fc2d1dc96a85b8 blob 35685609 33600527 31978828 d296935e6ac5f3f58b50c789394c9769116e9c34 blob 35658016 33593241 112485744 50636f931180a32764edadd854968a971a083f8a blob 28360290 25897864 233390 b9e4dd37428e879a258f297b7f5bcfb9ba869695 blob 13108002 11640713 66661788 08d2720b2414aa07ce419b17d5f80c333c7313b7 blob 12551621 11124009 89231035 6197a478a461275a0396f20c28487e9ae619a5f9 blob 11975135 11058259 148211988 1 50636f931180a32764edadd854968a971a083f8a 549eb0c73776fd0ede27a2fcb03366f76f45a13c blob 9136086 8166649 166451273 5bc0a0f04a7004bc16cfab1c091c6b369fb74049 blob 9072616 8270262 80951514 741480238a6a6ce612cf089245dd46d6890fba9f blob 8858569 8080252 101294029 744226651c55b14c1aa8affb78fba4fdf02b577c blob 7412220 6766404 186825167

This is where I'm stuck. I can git show these blobs and see that they look very much like jar files, but I can't figure out why they're still in the repo.

Various attempts to find their filenames failed.

git repack -a, git repack -ad, and git repack -Ad all seem to have no effect.

解决方案

Have you tried running git gc? http://www.kernel.org/pub/software/scm/git/docs/git-gc.html

这篇关于从存储库历史中删除大文件后,Git repo仍然很大的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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