Search notes:

Git objects

A git object is the unit of storage in Git. These objects are stored in the object database.

Object types

Object types can be one of
The type of an object can be determined with git cat-file -t:
git cat-file -t 3750c6e13c62eb71fc43a9a47c2908118cb16619
The content of an object can be viewed with with git cat-file -p:
git cat-file -p 3750c6e13c62eb71fc43a9a47c2908118cb16619

Object name

Git was designed like a content addressable filesystem, that is: files can be retrieved based on their content.
This leads to using the file content's SHA-1 hash as identifier for the object to be stored in the repository.
Synonyms for the SHA-1 value are object name, «hash» and «object identifier».
The SHA ID can be computed with git hash-object.

pack

To save space (for example when transmitting them), git compresses a set of objects into a pack.
The pack index is a list of identifiers and other information of the pack.
See also: git pack-objects

Unreachable object

An object which is not reachable from a branch, tag or other reference.

Looking at the object graph

git log --graph --oneline --decorate

Storage location

Objects are stored in the .git directory under the directory objects/ab/cde… where abcde… is the stored object's SHA-1 hash value.

See also

git show, git count objects, git fsck, git send-pack

Index