linuxlab.io
Tutorials▾
  • Linux & networking
    File system, processes, TCP/IP, BGP and OSPF
    →
  • Terraform & IaC
    HCL, state, plan/apply on a LocalStack sandbox
    →
  • Git & GitHub
    Object model, plumbing, branching, GitHub Actions
    →
All tutorials →
PricingAboutSign inCreate account
/
Intro
Lessons
Footer
linuxlab-TutorialsPricingAboutPrivacy & cookies
Copyright © 2026 LinuxLab. All rights reserved.
linuxlab.io
Tutorials▾
  • Linux & networking
    File system, processes, TCP/IP, BGP and OSPF
    →
  • Terraform & IaC
    HCL, state, plan/apply on a LocalStack sandbox
    →
  • Git & GitHub
    Object model, plumbing, branching, GitHub Actions
    →
All tutorials →
PricingAboutSign inCreate account
/
  • Introduction
  • Chapters
  • How it works
  • Lessons
  • Knowledge base
  • Interview prep
home/git/kb/Object model

kb/objects

Git object model: blob, tree, commit, tag

The Git object model has four object types, with SHA-1 as the key to each. What lives in `.git/objects/`, why Git is a key-value store, how `git add` creates a blob, and how `git commit` builds a tree. This is the most important chapter for understanding everything else.

  • blobBlob

    A Git object that stores the content of a single file. Just bytes, no name, no permissions, no date. The filename lives in the `tree`, not in the blob.

  • commitCommit

    A Git object: a snapshot of the entire project (via a tree) plus metadata including author, committer, date, parents, and message. The SHA of a commit includes the parent's SHA, which makes history cryptographically linked.

  • packfilePackfile

    A compressed file in `.git/objects/pack/` where Git packs many loose objects to save space and speed up network operations. Uses delta compression between similar objects.

  • sha1SHA-1 in Git

    The 40-character hash Git uses to address objects. Computed from content with a type prefix. Broken cryptographically in 2017 (SHAttered), but still the default in Git as migration to SHA-256 moves slowly.

  • tagTag

    A named pointer to a commit. Two kinds: lightweight (a file with a SHA in `refs/tags/`) and annotated (a separate object in `objects/` with author, date, and optional signature). For releases, use annotated.

  • treeTree

    A Git object that holds the listing of one directory: entries of the form `(mode, type, SHA, name)`. It references other tree objects recursively for subdirectories.

Footer
linuxlab-
Copyright © 2026 LinuxLab. All rights reserved.
Tutorials
Pricing
About
Privacy & cookies