QA
Intermediate LevelGit & GitHub

What are the 4 fundamental Git Object types (Blob, Tree, Commit, Tag)?

❓ Interview Prompt: Explain Git internal Object Database (.git/objects/), SHA-1/SHA-256 content-addressable storage, and the 4 object types.

Git stores zlib-compressed data in .git/objects/ as 4 core object types: Blobs (raw file content), Trees (directory listings and file names), Commits (pointers to root Trees and parent commits), and Tags (annotated release pointers).

Code Implementation Example

bash
git cat-file -t a1b2c3d
git cat-file -p HEAD
💡Inspecting Git object types and contents using git cat-file.
🎯 Interview Key Takeaway

Git object database consists of Blobs (file content), Trees (directories), Commits (DAG snapshots), and Tags.

#Git Internals#Blobs#Trees#Commits#Intermediate
Back to all Git & GitHub Questions→

More Git & GitHub Interview Questions

Beginner LevelGit & GitHub

Compare git rebase versus git merge and explain how git bisect finds regressions.

Beginner LevelGit & GitHub

What is the difference between git init and git clone?

Beginner LevelGit & GitHub

What are the Three Trees in Git (Working Directory, Staging Area / Index, Commit History)?