1 The Git Object Database
At its core, Git is a content-addressable filesystem. Everything you store — file contents, directory layouts, commits and tags — lives in the object database under .git/objects as one of four object types: blob, tree, commit and tag.
Each object is identified by a hash computed from its content. Store the same bytes twice and you get the same object — Git deduplicates automatically. This is why most Git operations are fast and local: they are simple lookups by hash.
# Count the objects currently in the database
git count-objects -v