Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Size of a Git repository vs Time

Tags:

git

I would like to produce a graph or table of the total repository size vs time (or commit).

Is there a git command or tool that does this? I have tried git log but it does not seem to have an option to export the size of the commits.

like image 347
odeits Avatar asked Dec 25 '13 22:12

odeits


1 Answers

The size of a commit is very hard to define. First of all, most commits recycle a lot of existing Git objects. If you don’t change a file between revision A and B, should the size of B include the size of that file? Also, the repository size itself is not that easily determined either. Due to Git’s compression system, it will repack objects from time to time. The way it does that can be influenced by multiple things, so it might not pack the same way if you do it again, resulting in a different total size.

What you could do is check the size of the checked-out tree of every revision. But of course the result you will get there will be far away from the repository’s size itself.

like image 157
poke Avatar answered Sep 23 '22 16:09

poke