Git object
One item in Git's database, a blob, tree, commit or annotated tag, stored under the hash of its content.
In more detail
Everything Git records becomes an object in .git/objects: file contents are blobs, directory listings are trees, and snapshots with their metadata are commits. Objects are never edited in place; a change always produces a new object with a new ID. git cat-file lets you read any object by its ID.
Related terms
- blob — The Git object that holds the contents of one file, with no file name attached.
- tree object — The Git object that lists one directory: each entry's name, file mode and the ID of the blob or sub-tree it points at.
- commit — A saved snapshot of the whole project in Git, together with its author, committer, time, message and a pointer to the commit before it.
- annotated tag — A tag stored as its own Git object, with the tagger's name, a date and a message, pointing at a commit.
- object ID — The hash that names a Git object, such as a commit, and that you type to refer to it.
- git cat-file — A low-level command that prints a Git object's type (-t), size (-s) or contents (-p) given its ID or another revision.
Taught in
- A Repository Is A Folder With A Memory — Advanced Git Internals & Distributed Workflows
- The Three Areas: Working Tree, Index, Repository — Advanced Git Internals & Distributed Workflows
- Undoing: restore, reset, revert And stash — Advanced Git Internals & Distributed Workflows