I'm using the Versions application on a Mac to handle an SVN repository for my files. My working copy is around 6 MB, yet my repository is only 1.4 MB, and I am holding five revisions in the repository!
How can this be?
SVN compresses one version of your code the differences between each version. That is why it does not take much space.
To keep the repository small, Subversion uses deltification (or deltified storage) within the repository itself. Deltification involves encoding the representation of a chunk of data as a collection of differences against some other chunk of data. If the two pieces of data are very similar, this deltification results in storage savings for the deltified chunk—rather than taking up space equal to the size of the original data, it takes up only enough space to say, “I look just like this other piece of data over here, except for the following couple of changes.” The result is that most of the repository data that tends to be bulky—namely, the contents of versioned files—is stored at a much smaller size than the original full-text representation of that data. And for repositories created with Subversion 1.4 or later, the space savings are even better—now those full-text representations of file contents are themselves compressed.
More detail can be found here
Nawaman's answer already explained that the data in the repository is compacted quite efficiently.
The other half of the story is that subversion keeps a pristine copy of each file inside the .svn
folders of your working copy. This enables subversion to handle svn status
or svn diff
commands without needing to contact the repository server, but it doubles the size of your working copy.
Your working copy normally contains a lot of additional temporary files such as object code and precompiled headers that are not required to be revision controlled. I guess if you clean the working copy, or make a new checkout it will be much smaller.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With