Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Subversion repository has a small file size compared to working copy?

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?

like image 415
Michael Waterfall Avatar asked Sep 27 '09 23:09

Michael Waterfall


3 Answers

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

like image 198
NawaMan Avatar answered Oct 05 '22 23:10

NawaMan


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.

like image 34
Wim Coenen Avatar answered Oct 06 '22 01:10

Wim Coenen


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.

like image 21
1800 INFORMATION Avatar answered Oct 06 '22 01:10

1800 INFORMATION