Determine total size of SVN directory/trunk

Adam M-W picture Adam M-W · Nov 16, 2009 · Viewed 30.1k times · Source

Is there a way to count/calculate the total size of a svn directory if you were to checkout a revision?

I have limited internet downloads so I need to know how big something is before I go and download it.

Thank you.

Answer

Nico Hailey picture Nico Hailey · Nov 10, 2011

This is my modification to the answer. It reports how many files are below a certain directory in svn and the total size.

svn list -vR svn://svn/repo/subdir|awk '{if ($3 !="") sum+=$3; i++} END {print "\ntotal size= " sum/(1024*1024)" MB" "\nnumber of files= " i/1000 " K"}'