运行 repack 后 Git 存储库增长
我们一直在使用 Subversion,并正在考虑迁移到 git。所以我是个 git 文盲。我使用 git svn clone 将 svn 历史记录复制到 git,我的 git 文件夹有 3.1G。我遵循了几个博客的一些建议来缩小它并运行:git repack -ad -f --window=100
它成功处理了 494,755 个对象,但当我查看磁盘大小时,它现在使用的是 3.7G。所以我认为会缩小的东西却让它显着变大。我尝试使用
再次运行它 git repack -ad -f --window=250 --深度=250
但尺寸没有变化。 git prune 命令似乎也没有执行任何操作。克隆这个花了几天时间,所以我不想重新开始。
有什么办法可以恢复到较小的尺寸,或者有人对为什么重新包装使其变大有什么想法吗?
We've been using Subversion and are considering moving to git. So I am very much a git illiterate. I used git svn clone
to copy the svn history to git and my git folder was 3.1G. I followed some advice from several blogs to shrink it and ran:git repack -a d -f --window=100
It processed 494,755 objects successfully but when I look at the disk size now it is using 3.7G. So what I thought would shrink it made it significantly larger. I tried running it again withgit repack -a d -f --window=250 --depth=250
but no changes to the size. The git prune
command also didn't appear to do anything. It took several days to clone this, so I would rather not start over.
Is there any way to go back to the smaller size, or any ideas anyone has on why repack made it bigger?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您必须将存储库从 SVN 复制到 git,那么 git-svn 是一个好方法,但说实话,最好在 git 中本地工作。也就是说,我以前用过这个,这是最好的指南我发现了这件事。
实际上,您可能想使用
-r
选项来处理正在导入的修订历史记录。我还做了一个:删除所有 .svn 文件夹。我不打算从 git 提交到 svn,所以这对我来说有好处,但如果您打算在本地使用 git 并提交到 SVN 存储库,那么您必须对最佳方法进行更多研究这样做。
另外 git-gc 有助于压缩对象。看看这是否有助于减少您的存储库的大小。
Git 很棒,所以我希望你会喜欢它并改用它。
git-svn
is a good way if you have to copy a repo from SVN to git, but honestly, it is better to work natively in git. That said, I've used this before and this is the best guide I found on the matter.Really, you may want to play around with the revision history you are importing by using the
-r
option. Also I did an:to remove all the .svn folders. I don't plan on commiting from git to svn, so that was good for me, but if you plan to use git locally and commit to your SVN repo, then you'll have to do a little more research on the best way to do that.
Also
git-gc
helps to compress objects. See if that helps reduce the size of your repo.Git is great so I hope you find you like it and switch over.