On 09/10/2021 10:12, Bagas Sanjaya wrote: > On 09/10/21 14.43, ZhangJinbao wrote: > >> Third, when a commit event occurs, the current blob file stores the >> full amount of data, while the previous version stores the >> incremental data >> > > When you `git commit`, Git will initially write objects related to the > commit (blob, tree, and commit) as loose objects. Some point on the > time, Git will repack many loose objects into one big packfile and > write the corresponding pack index. Delta compression is applied when > writing the packfile. > Git is multi-layered, and multi-faceted. So often the impression given isn't the same as what happens internally. All commits are full snapshots, even if git (normally) shows only the changes for previous diffs. But then git will, at a convenient point 'pack' all those snapshots (fairly efficiently) so that the local git storage of the whole repository, with full history, (typically) is no bigger than the checked out files. The packing is part of that layering. There are similar facet/layer effects from the Staging area ("index") / Object store viewpoints. The https://git-scm.com/book/en/v2/Git-Internals-Plumbing-and-Porcelain is worth a read, along with other descriptions. Philip