Gwater17
Gwater17

Reputation: 2314

Why does git-sizer say my files are 10 times the size of what my Mac says the entire directory size is?

I cloned the express repo and used git-sizer to run the command git-sizer --verbose without making any changes to the repo. I saw that it listed the total size of blobs as 120 MiB. However, when I look at the size of the entire express directory on my mac by right clicking on the express directory in my gui, right clicking and selecting get info it says the entire directory is 10.6 MB and 11.4 MB on disk. 

How could this be if the total size of the blobs alone is 10 times that?

Upvotes: 1

Views: 310

Answers (1)

Mark Adelsberger
Mark Adelsberger

Reputation: 45659

The most likely explanation is if the tool you're using is calculating the full size of each BLOB and summing them all up... this could be a useful metric, but would not be reflected in (or reflective of) the disk space actually consumed in your repo.

The BLOBs' data may appear in two places on your disk:

For BLOBs that are part of the currently-checked-out commit's TREE, there is a file in the working directory. This file is what the BLOB represents, so its size might be what the sizer utility is reporting; but only files for the current version (not all the historical stuff) are present here.

Every BLOB is in the database. But those are compressed, and may also be reduced to deltas, so the physical space they consume is likely much less than the sum of the sizes of the individual BLOBs.

Upvotes: 1

Related Questions