什么是“自动打包存储库以获得最佳性能”意思? [英] What does "Auto packing the repository for optimum performance" mean?

查看:197
本文介绍了什么是“自动打包存储库以获得最佳性能”意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的git回购存在问题。在过去的几天里,每当我推送到服务器时,我都会收到以下消息:自动打包存储库以获得最佳性能,并且它似乎没有消失并返回shell。



我也尝试检出一个新的分支,然后在我之前的分支上做一个rebase,然后执行 git gc 来删除未使用的历史对象,然后做了推,但仍然显示此消息。请让我知道我的回购是怎么回事。

它可以完成,一切都会好的。



在大多数可能会增加存储库中松散(未压缩)对象数量的操作中(包括推送),Git会调用 git gc --auto 。如果有足够的松散对象(默认情况下,至少6700),它将调用 git repack -d -l <​​/ code>来打包它们。如果有太多独立包装,它也会将它们重新包装成一个。

包是一个增量压缩的单个文件,包含大量的对象。将对象存储在包中会更高效,但是需要时间来打包(压缩)对象,所以Git最初会创建松散对象,然后通过自动调用 git gc - auto



如果让Git完成重新打包,那么暂时不会再发生。确实需要一段时间,特别是如果你有很多大的二进制对象,但是如果它触发的话,那么这是一个迹象,它可能会大大减少回购所花费的磁盘空间。如果你真的不希望它发生,你可以改变配置参数 gc.auto 。如果将它增加到比6700大得多的东西,它会发生得不那么频繁,但是当它发生时会花费更长的时间。如果你减少它,它仍然必须做你目前的重新包装,但随后它会更频繁地发生并更快完成。



请参阅 man git-gc (在<$ (code> gc.auto - auto )和 man git-config >)获取更多信息。


I'm having a problem with my git repo. For the last couple of days whenever I do a push to the server I get this message: "Auto packing the repository for optimum performance", and it does not seem to go away and return the shell.

I also tried checking out to a new branch and then doing a rebase on my previous branch and then did git gc to remove the unused history objects and then did a push but still this message appears. Please let me know what's going on with my repo.

解决方案

Short version: it means what it says, and if you just let it finish, all will be well.

During most operations which can potentially increase the number of loose (unpacked) objects in the repository (including pushes), Git invokes git gc --auto. If there are enough loose objects (by default, at least 6700), it will then invoke git repack -d -l to pack them. If there are too many separate packs, it will also repack them into one.

A pack is a delta-compressed single file, containing a large number of objects. It's more efficient to store objects in packs, but it takes time to pack (compress) objects, so Git initially creates loose objects, then packs them in batches now and then, via automatic invocation of git gc --auto.

If you let Git finish repacking, this won't happen again for a while. It can indeed take a while, especially if you have a lot of large binary objects, but if it's triggering, then it's a sign that it will probably drastically reduce the amount of disk space taken by the repo. If you really don't want it to happen, you can change the config parameter gc.auto. If you increase it to something much larger than 6700, it will happen less frequently, but take longer when it does. If you decrease it, it'll still have to do your current repack, but subsequently it will happen more often and finish more quickly. If you set it to 0, it will disable automatic repacking.

See man git-gc (under --auto) and man git-config (under gc.auto) for more information.

这篇关于什么是“自动打包存储库以获得最佳性能”意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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