The tutorials you read are almost correct. Git normally stores new versions of files as it is, only compressing them with zlib.
However, they would quickly eat up all your hard drive even if they're compressed. To prevent this, git peiodically scraps older versions of files and stores them in a large compressed archive, which is called packfile. When creating a packfile, git checks if there are similar files between them, and stores only delta(diff between files)s of them.
However, git does not do this per every commit, and only does for older, rarely accesssed versions, which is why most tutorials omit this detail.
https://www.quora.com/How-exactly-does-the-Git-store-change-files/answer/Kim-HyunKang?ch=10&share=f7eda9d0&srid=hB9T3
Post #2009
268
Forwarded from Lev