Fragmented - AI Developer Podcast

197: .git internals with Gordon πŸ”§

May 4, 2020
Ask episode
AI Snips
Chapters
Transcript
Episode notes
INSIGHT

Content-Addressable Object Store

  • Git stores content-addressable objects under .git/objects using compressed files named by SHA-1 hashes.
  • Use git-cat-file to reveal an object's type and contents because files are zlib-compressed with headers.
INSIGHT

Why Git Uses Content Hashes

  • Git is distributed, so identifiers are content hashes rather than centralized incremental numbers.
  • Everyone agrees on object SHAs, enabling offline work and later reconciliation with remotes.
INSIGHT

What Staging Actually Does

  • Staging writes content into the index and creates a loose object in .git/objects referenced by its SHA.
  • The index maps filenames to those SHA-addressed objects before a commit binds them into a tree.
Get the Snipd Podcast app to discover more snips from this episode
Get the app