Object 타입 넷과 content-addressable store
Git 이 아는 모든 것이 .git/objects/ 의 네 object 타입 중 하나로 저장, 내용의 SHA-1 hash 로 주소지정. blob, tree, commit, tag 를 repo 에서 식별할 수 있게 되면 상위 Git 명령이 마법 같지 않아져 — 다 이 네 모양의 조작.
Blob 은 파일 하나의 raw bytes 저장. 파일명 없음, permission 없음 — 그냥 내용. 같은 내용 파일 둘 (중복 config, 두 test suite 의 같은 fixture) 은 같은 blob 으로 hash 되고 한 번 저장. Tree 는 디렉토리 listing 저장: 이름, mode (파일 permission + 타입), blob (파일) 또는 다른 tree (서브디렉토리) 의 hash. Tree 가 blob 에 이름과 구조 부여.
Commit 이 다 묶음: root tree hash (프로젝트 스냅샷), parent commit hash, author + committer + timestamp, 메시지 가진 작은 object. Commit parent 따라가면 history 거꾸로, commit tree 읽으면 옆으로 '이 시점 모든 게 어땠나' 진입. Tag 는 더 드문 네 번째 타입: metadata 있는 명명 pointer, annotated tag 에 사용. Lightweight tag 는 그냥 ref, tag object 아님.
Store 자체가 content-addressable. echo "hello" | git hash-object --stdin 이 hash 계산, git cat-file -p <hash> 가 어떤 object 든 다시 읽음. Hash 의 첫 두 글자가 .git/objects/ 아래 디렉토리 이름, 나머지 38 글자가 파일명 — 그래서 초기 Git 검사가 .git/objects/3a/4f5d6e... 같은 파일 보여줌. Repo 커지면 Git 이 많은 object 를 효율 위해 pack 파일로 압축 (다음 레슨). Mental model 은 압축 후에도 살아남: hash → object → content.