Sunday, September 18, 2022

Mercurial (hg), git, subversion (svn) repository size comparison

Compared git, mercurial, and subversion for local-only repository to use for local history of notes, and other personal non-shared files, e.g. financial log, for which the edit history is useful. 

 Mercurial turned out to be the most space efficient, especially for binary files. For subversion there's also overhead for local working copy tracking, which is a copy, so your working copy occupies 2x space + repository space. 

Empty repository sizes (with du command): 

116K .git/ 9 directories, 17 files 

28K .hg 3 directories, 3 files

empty svn repo du: 160K, 10 directories, 28 files 

140K .svn/ 

After adding a gimp .xcf 45M file, each new commit increases git's and svn's repositories to almost the same size, as if each commit contains an individual copy, while the hg repo increases slightly as if only a binary diff is stored. After two edits the repository sizes are: 

git: 91M

hg: 39M

svn: 129M 

So Mercurial is a clear winner here, and suitable for binary data without LFS-like hacks.