What are the four object types in Git's object database?
BeginnerConceptGit internals: objects, refs and the index
Answer
Blob, tree, commit and annotated tag. A blob stores file contents only (no name, no mode). A tree maps names and modes to blobs and sub-trees, so it represents a directory. A commit points to one tree, zero or more parent commits, and carries author, committer and message. An annotated tag points to another object and carries a tagger and message.
git cat-file -t HEAD # commit
git cat-file -p HEAD^{tree} # list the root tree
More on Git internals: objects, refs and the index
Is Git a snapshot system or a diff system?BeginnerWhat is the SHA-1 (or SHA-256) hash of an object and how is it computed?BeginnerWhere does Git store objects on disk, and what are loose objects versus packfiles?IntermediateWhat exactly is a branch, and what does creating one cost?IntermediateWhat is HEAD?BeginnerWhat is a detached HEAD and how do you recover work done in it?Intermediate