git存储模型浪费吗?

发布于 2024-12-03 07:59:13 字数 462 浏览 0 评论 0原文

我正在阅读有关 git 如何在 Git 对象模型1

听起来如果我更改文件中的一行,它将重新存储整个文件。与仅存储差异的 Subversion 相比,这会浪费大量空间吗?

(或者我误解了存储模型?)

1 截至 2011 年提出问题时。当前最接近的链接是 Git 内部 - Git 对象

I was reading about how git stores changes in The Git Object Model1.

It sounds like if I change one line in a file, it's going to re-store the entire file. Does this waste a lot of space compared to say, Subversion which only stores diffs?

(Or am I misunderstanding the storage model?)

1 As of 2011 when question was asked. Current closest link is Git Internals - Git Objects.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

韵柒 2024-12-10 07:59:13

Git 最终会在其内部维护的常规过程中将所有内容打包到增量压缩档案中,此时这不再是问题。

不过,今天这并不是一个真正的问题。 Git 的理念是磁盘空间很便宜,并且最好针对速度而不是存储效率进行优化。与只需要一半磁盘空间的 SCM 相比,速度快一倍的 SCM 可能会为您提供更好的服务。

请参阅 Git 书籍 中有关 Packfile 以及 git repackgit-pack-objects

Git will eventually pack everything into delta-compressed archives during the regular course of its internal maintenance, at which point this is no longer an issue.

This isn't really an issue today though. Git's philosophy is that disk space is cheap, and it's better optimize for speed rather than storage efficiency. Chances are you'll be better served by a SCM which is twice as fast, as opposed to one which requires half the disk space.

See the Git Book's chapter on The Packfile as well as git repack and git-pack-objects.

葬シ愛 2024-12-10 07:59:13

Git 确实使用 zlib 压缩存储的文件,并且还打包它们以更高效的存储

Git does compress stored files with with zlib and it also packs them for a more efficient storage.

森林迷了鹿 2024-12-10 07:59:13

其实不是。有一篇很好的文章描述了 git 的优点: http: //web.archive.org/web/20110902055701/http://whygitisbetterthanx.com:80/

Actually not. There is a good article describing the advantage of git: http://web.archive.org/web/20110902055701/http://whygitisbetterthanx.com:80/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文