没有远程压缩对象的git拉 [英] git pull without remotely compressing objects

查看:89
本文介绍了没有远程压缩对象的git拉的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个完整的zip文件库,重新压缩这些文件将浪费时间。

I have a repository full of zip files, re-compressing theses files will be a waste of time.

我试图设置核心。压缩= 0 在远程和本地复制没有成功

I've tried to set core.compression = 0 on the remote and the local copy without success

git config core.compression 0
git config core.loosecompression 0

git pull 还在做

remote: Counting objects: 23, done.
remote: Compressing objects: ...


推荐答案

我遇到的时间问题是由delta压缩造成的。

The time problem I had was caused by delta compression.

我的解决方案是

The solution for me was

echo '*.zip -delta' > .gitattributes
git gc

我会引用这个出色的响应
from http ://lists-archives.org/git/719515-serious-performance-issues-with-images-audio-files-and-other-non-code-data.html

I will quote this excellent response from http://lists-archives.org/git/719515-serious-performance-issues-with-images-audio-files-and-other-non-code-data.html


Git确实在zlib中花费了相当一部分时间用于某些工作负载,但
不应在分钟数量级上造成问题。

Git does spend a fair bit of time in zlib for some workloads, but it should not create problems on the order of minutes.

对于推和拉,您可能会看到delta压缩,
对于大文件可能会很慢

For pushing and pulling, you're probably seeing delta compression, which can be slow for large files


core.compression 0#似乎没有工作。

core.compression 0 # Didn't seem to work.

这应该禁用松散对象和对象的zlib压缩
包装内。它可以节省一些时间,对象不会被
压缩,但是您将失去任何文本文件的大小优势。

That should disable zlib compression of loose objects and objects within packfiles. It can save a little time for objects which won't compress, but you will lose the size benefits for any text files.

但它不会关闭增量压缩,这是在推拉过程中
压缩...阶段的过程。
$ b

But it won't turn off delta compression, which is what the "compressing..." phase during push and pull is doing. And which is much more likely the cause of slowness.


pack.window 0

pack.window 0

它设置git在进行delta
压缩时会考虑的其他对象的数量。将它设置得较低应该会提高推/拉时间。但
你将失去
非图像文件(和git的元对象)的delta压缩的实质性好处。因此,特定文件的
上方的-delta选项是一个更好的解决方案。

It sets the number of other objects git will consider when doing delta compression. Setting it low should improve your push/pull times. But you will lose the substantial benefit of delta-compression of your non-image files (and git's meta objects). So the "-delta" option above for specific files is a much better solution.


echo'* .jpg -delta '> .gitattributes

echo '*.jpg -delta' > .gitattributes

另外,请考虑重新包装您的存储库,这会生成一个
的包文件,推/拉。

Also, consider repacking your repository, which will generate a packfile that will be re-used during push and pull.

请注意,必须在您从中取回/取出的回购库中进行设置,取/拉到。

Note that the settings have to be made on the repo you are fetching/pulling from, not the one you are fetching/pulling to.

这篇关于没有远程压缩对象的git拉的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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