git object

Creator
Creator
Seonglae ChoSeonglae 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
Artisanal Handcrafted Git Repositories | drew's dev blog
How to lovingly handcraft your own git repositories
Artisanal Handcrafted Git Repositories | drew's dev blog
Scaling Git's garbage collection | The GitHub Blog
At GitHub, we store a lot of Git data: more than 18.6 petabytes of it, to be precise. That's more than six times the size of the Library of Congress's digital collections. Most of that data comes from the contents of your repositories: your READMEs, source files, tests, licenses, and so on.
Scaling Git's garbage collection | The GitHub Blog
 
 
 

Backlinks

Git Structure

Recommendations