Hacker News new | past | comments | ask | show | jobs | submit login

> Naively when you read a git diff or a pull request, you might think like me, that git is storing a diff between A and B and just displays it when needed. But in reality it stores the full file in the object storage.

I thought logically git stored every file, but implementation-wise, it does git-object compaction. So in reality, it's not actually storing every file on disk, no?




The objects directory stores every file (and tree, commit, etc). Pack files are an optimization storing diffs.


Which is such a genius implementation. You get the straightforward implementation of using plain files (e.g. not deltas), while also being able to get the storage boost from storing deltas.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: