What is the Git object model?

Definition

The Git object model represents files and history as immutable objects. Blobs store file content, trees describe directory entries and commits point to a root tree and parent commits.

Each object is identified by a hash derived from its content. This provides integrity and deduplication, but reconstructing a checkout can require many related objects and storage lookups.

ELI5

The Git object model stores a repository as linked, content-addressed objects. Blobs hold file data, trees describe folders, commits point to snapshots and parents, and annotated tags name important objects.

For example, checking out one commit means following its tree links until Git finds the required blobs. Each object's identifier comes from its contents, which helps detect changes and reuse identical data.

Which objects are part of the Git object model?

Git uses blob, tree, commit and annotated tag objects, each identified by a content-derived object ID.

Why does Git use content-addressed objects?

Content addressing detects changes, supports integrity checks and allows identical content to be stored and transferred efficiently.

  1. Why Git Hosting Is Hard beside a flat diagram of replicated repository servers and a latency bottleneck
Definition card for Git object model: What is the Git object model?

The Git object model stores repository history as content-addressed commits, trees, blobs and annotated tags connected by hashes.