git object

Creator
Creator
Seonglae Cho
Created
Created
2021 Apr 23 9:56
Editor
Edited
Edited
2025 Jul 19 22:4
Refs
Refs

git의 모든 객체 oid는 hash 로 표현

3 types:
  • blob: file content
  • tree: directory structure containing mode, name, and 20-byte hash repeated
  • commit: tree hash, parent(s), author/committer, message, signature
Everything is stored in the format "type + space + length + NUL + content" then compressed with zlib. The filename is a SHA-1 hash (first 2 characters as directory name + remainder as filename).
 
 
 
 

Handcrafted reverse-engineering hash structure (
git object
)

Git's internal design is simple and elegant, and once you understand it, implementing it isn't difficult
 
 
 

Backlinks

Git Structure

Recommendations