Overview
Git has a few fundamental types that serve as the foundation for its CAS system, expanded upon in each subsequent section.
Blobs
The binary large object (blob) is used to represent arbitrary files.
Trees
The tree is used to represent directories. It maintains filenames of any contained blobs.
Commits
Commit objects provide metadata information about particular trees.
While a tree represents a particular directory state of a working directory, a commit represents that state in “time”, and explains how to get there.
Tags
Tags are (possibly indirect) pointers to a git object. They usually point to a commit but aren’t required to. There are two types of tags:
- Lightweight tags are git refs that never move. These aren’t really git objects in the same way the other objects are.
- Annotated tags are real objects that provide metadata about the object being pointed to.
Bibliography
- Scott Chacon, Pro Git, Second edition, The Expert’s Voice in Software Development (New York, NY: Apress, 2014).