简体   繁体   English

SVN 相对于提交的二进制文件的存储库大小

[英]SVN repository size relative to committed binary files

In an attempt to better understand how SVN handles binary files I tried a little experiment.为了更好地理解 SVN 如何处理二进制文件,我尝试了一个小实验。 I was hoping to find that SVN would recognize the same binary in different locations and not create multiple copies of the same file.我希望发现 SVN 可以识别不同位置的相同二进制文件,而不是创建同一文件的多个副本。 What I found raised more questions than it answered.我发现的问题比它回答的问题多。 I'm hoping there's an SVN expert out there who can help me understand this.我希望有一位 SVN 专家可以帮助我理解这一点。

Note 1: MyTest.dll is 2,108 kb注 1:MyTest.dll 为 2,108 kb

Note 2: I realize that SVN is doing some compression behind the scenes, it still doesn't explain the results.注2:我意识到SVN在幕后做了一些压缩,它仍然没有解释结果。

Here's the experiment:这是实验:

1.) I created a new repo 1.) 我创建了一个新的仓库

2.) I added MyTest.dll to trunk & committed -> repo size = 66 k 2.) 我将 MyTest.dll 添加到主干并提交 -> 回购大小 = 66 k

3.) Added /1/ and /1/MyTest.dll & committed -> repo size = 735 k 3.) 添加 /1/ 和 /1/MyTest.dll 并提交 -> 回购大小 = 735 k

4.) Added /2/ and /2/MyTest.dll & committed -> repo size = 2 mb 4.) 添加 /2/ 和 /2/MyTest.dll 并提交 -> 回购大小 = 2 mb

5.) Added /3/ and /3/MyTest.dll & committed -> repo size = 2.1 mb 5.) 添加 /3/ 和 /3/MyTest.dll 并提交 -> 回购大小 = 2.1 mb

6.) Added /4/ and /4/MyTest.dll & committed -> repo size =3.4 mb 6.) 添加 /4/ 和 /4/MyTest.dll 并提交 -> 回购大小 =3.4 mb

Can anyone out there explain why the change in repo size with each commit appears so random relative to the actual content of the commit?任何人都可以解释为什么每次提交的 repo 大小的变化相对于提交的实际内容显得如此随机?

Thanks!谢谢!

No, it won't search whole repository (which may be gigabytes) to see if the file already was commited.不,它不会搜索整个存储库(可能是千兆字节)以查看文件是否已提交。

Only if you svn copy the file within the repository, new copy won't be introduced.仅当您svn copy存储库中的文件时,不会引入新副本。

Repo's grow quite large (even if you only work on a small number of files) because all the changes for each commit are saved so that you can always revert to an older file at any time.存储库变得非常大(即使您只处理少量文件),因为每次提交的所有更改都已保存,因此您可以随时恢复到旧文件。 There's a lot of information that SVN and related tools keeps around for housekeeping and caching/indexing of files as well that tends to take up space. SVN 和相关工具保留了很多信息,用于文件的内务管理和缓存/索引以及往往会占用空间。 Depending on how many files are changed per commit is usually what the increase in size of the repo will be because these commit "patch" files are created internally so that SVN knows what exactly the changes were which allows for the revert feature to work all the way back to commit 1. It's hard to explain really where a lot of the rest of the space that is being used is being filled with as I use git most of the time and git tends to have sometimes smaller repo's but it might just be internal stuff that SVN uses for its functionality.取决于每次提交更改了多少文件,通常会增加存储库的大小,因为这些提交“补丁”文件是在内部创建的,因此 SVN 知道确切的更改是什么,这允许恢复功能在所有回到提交 1. 很难解释很多正在使用的空间的 rest 被填满的地方,因为我大部分时间都使用 git 和 ZBA9F11ECC3497D99993B933FDC2BD6,但有时它可能只是内部较小的 repo' SVN 用于其功能的东西。 I hope this helps clear some things up.我希望这有助于澄清一些事情。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM