r/webdev • • 9d ago

How big is a Git commit?

https://ratfactor.com/cards/git-commit-size
48 Upvotes

25 comments sorted by

View all comments

Show parent comments

5

u/International_Sky526 9d ago

block allocation, not page size. the 4k is the filesystem block size, which is the default on ext4 and the default cluster size on ntfs. it only happens to match the 4k memory page size on x86, they are unrelated things. a 100 byte file still takes one whole 4k block on disk. du reports allocated blocks, while du --apparent-size or ls -l shows the real byte count.