Git vs SVN: website storage efficiency [closed]

I know that SVN (Subversion) stores files' deltas in order to efficiently store data. Git however, is a little more complex. What I'm wondering is that if I were to store plain HTML, image and js files, and keep track of their changes with either of them, which one would result in a better storage efficiency and why? I'm especially more interested in HTML files. At first there shouldn't be much difference. However, as the website changes, especially the home page, the difference should be obvious.

I could try both of them and compare them, however, it would take much time to see any real results. Hence, I decided to see which one should be theoretically more efficient.


Solution 1:

git will absolutely win, hands down. It is quite common that for git repository with text files (like HTML) metadata with all history in .git directory will be smaller than checkout of the whole tree. (You may want to run git gc once in a while, but git will run it automatically if it notices that object store is not very optimized).

For SVN, on other hand, even simple checkout will be at least 2x - it will contain all tree and also full backup of it in .svn directories, and it will not include any history - and it will still depend on working server.

Take a look at article Repository Formats Matter:

The Mozilla CVS repository was 2.7GB, imported to Subversion it grew to 8.2GB. Under Git, it shrunk to 450MB. Given that a Mozilla checkout is around 350MB, it’s fairly nice to have the whole project history (from 1998) in only slightly more space.

It is difficult to explain, but once you work with git even a bit, you will be blown away by its impossible speed. Everything is so fast, that it changes how you think about source control and what you do with it.

There are many other advantages to git, but I obviously cannot cover them all here. I would recommend reading some good book about it, for example ProGit.