DEV Community

NullVoxPopuli
NullVoxPopuli

Posted on

Repository growth over time

For large corporate projects where performance often comes up, it's important to take things in to perspective.

I like to use codebase size over time, which can be measured with tokei.

And then there is are a couple secret git commands to checkout commits with relative dates.

Git will actively fight you trying to fetch every commit for all of time.

See this other post for more/related information.

git checkout $(git rev-list -1 --before="Aug 15 2024" main)
Enter fullscreen mode Exit fullscreen mode

There is a more ergonomic way to checkout old commits, but it only works if you already have the list of commits fetched, which is less easy to do than the above

git checkout main@{1.year.ago} 
# warning: log for 'main' only goes back to Tue, 15 Jul 2025 ...
Enter fullscreen mode Exit fullscreen mode

This would get you the wrong commit (from only a month ago, instead of a year ago)

Once we have the old commit (verified with the top of git log), we can run tokei

tokei
#  Total                 18638      1981370      1671372        92166       217832
#                                   ^ total lines
Enter fullscreen mode Exit fullscreen mode

Top comments (0)