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

Handy command line benchmarking tool

Stan Rogers

Ultimate Hot Couch Guy

Quote on Java Generics

The Programmer Tendency

Figure out undocumented JSON with gron

Mental Model of Dental Hygiene

Book Review: Swastika Night

Is there a name for this construction?

Fun with negation and idioms