为什么 git 存储库比 SVN 存储库小很多?

Why are git repos so much smaller than SVN repos?

我最近将一个包含 50 万次提交的巨大 SVN 存储库转换为数百个 git 存储库。

与 SVN 相比,git 存储库很小。我的经理认为我做得不对!我使用了 svn2git 并且我认为它工作得很好。

只是想知道它变小的主要原因是什么?

svnvsgit.com 回答了您的问题:

Subversion and Git repositories with equivalent data will have approximately the same size. Except for the case of storing a lot of binary files, when Subversion repositories could be significantly smaller than Git ones (because Subversion’s xdelta delta compression algorithm works both for binary and text files).

Repository Site Benchmarks 下,他比较了 SVN 和 Git 并发现:

the difference of repository size is truly insignificant because the Git repository is only 10% smaller than the corresponding Subversion one

结论:

  • Git 的存储库总体较小
  • 如果你有很多二进制文件,SVN 会更小

如果您的 Git 存储库比较大小明显更小(超过 20%),则很有可能出了问题。