Realizations That Helped Me Understand Git


This is unlikely to help you understand git, but I’ve been surprised before.

  • Git doesn’t have an inherent concept of diffs (though stuff may be stored internally that way for efficiency). Every commit can be thought of as a static snapshot of your project. Diffs are computed on the fly.
  • Git is a content addressable filesystem. Basically a hash table with signature {commit ID: Filesystem state at that ID}. All operations are computed from that basic data structure.
  • Commits know their parents but not their children.
  • Tags and HEAD are just pointers.
  • Being careful about what you commit in what order will save you a lot of pain and rebasing.
  • A lot of Git’s commands are named surprisingly well iff you know its data model.
    • Pickaxe is still a stupid name.
  • Being able to visualize a DAG changing and where you are on it is what made all the difference.
  • Git still isn’t easy to use. I can never put it in the back of my mind.

Related Posts

Middle School by Bo Burnham

How to Disable Disqus Ads on your Blog

Derivation of Reservoir Sampling

Fun with Python Iterators: Linked Lists Made Easy

Notes for November 11, 2018

Underrated Vim Option: undofile and undodir

Hot Take on Solo Travel: Starve

Alan Perlis

Book Notes: The Map of My Life by Goro Shimura

Prague