Skip to content

Git Repo Size Inaccuracy

As it is probably apparent, my Git repo is of an abnormal size. This page is here to address that and the issues I have had with repo size for the past few months.

The Actual Size of the Repository

As seen below, the legitimate local size of my repository on my computer is only 28.9 megabytes.

Every single image I put on my weekly pages is a JPG and is also called to at minimum 300 pixels on the height portion of the resolution and additional quality compression on the JPG is also sometimes used, each image is around 20 kilobytes. I have a few outlying images of slightly larger resolution vertically (around 500 or so) and I do this only for super important images which have lots of detail and which need to be larger, but even these only makeup about 40-50 kb per.

What I Tried to do to Fix It Initially

Initially when this issue first popped up I discovered that in the hidden .git folder on my local repository a folder called “Objects” had around 130 mb of information in it that when I tried deleting crashed my repository. So around week 3 or so (When I first found this out) I ran a command to delete all the commits in my repository back to the first ever push I had, essentially reverting the version. This “deleted” or atleast removed from what I could find in the commit list all the commits in between the initial first push and what I currently had including the most recent version which I thought would fix this issue. I then pushed my site that I had before. This fixed the local size back down to around 8 megabytes in both the hidden .git folder as well as the docs folder, however, my website still displayed around 130 mb.

Reaching out to the Fab Community

After fighting with this issue for a few months, I went onto both Mattermost as well as posting it to the Fab issue tracker built into GitLab. These are the responses I received:

These responses aligned somewhat with the research that I had gained, that git manages deleted commits itself and that I wouldn’t be able to do anything with garbage collection (gc) myself due to my permissions in the repo, so from what I have found so far, there is nothing I can do to fix this issue but luckily the true size of my site is actually around 28 mb when cloned.

Why I Made this Page

Overall I made this page with the intention to address this issue and to make it known that the size isn’t due to my laziness or not-compressing my images but rather due to a strange git issue that caused my objects folder to explode.


Last update: May 16, 2022