3 ms·
Git actually does not work with deltas; each commit contains the hash of a tree object [0], which contains the hashes of the files within it [1]. This tree is e
by zanecodes 6y ago
Git actually does not work with deltas; each commit contains the hash of a tree object [0], which contains the hashes of the files within it [1].
This tree is effectively a snapshot, since it contains every file hash in the working directory at a certain point in time.
Since Git uses the file hash instead of just the file path, it doesn't have to download the files whose hashes haven't changed since the last commit, which is what makes it behave somewhat as if it is operating on a delta.
[0] https://git-scm.com/book/en/v2/Git-Internals-Git-Objects#_git_commit_objects https://git-scm.com/book/en/v2/Git-Internals-Git-Objects#_gi...
[1] https://git-scm.com/book/en/v2/Git-Internals-Git-Objects#_tree_objects https://git-scm.com/book/en/v2/Git-Internals-Git-Objects#_tr...