Git Demystified

Learn Git through mental models, not memorization

Repository State

70fa70fa839 Update greetingmainHEAD

Why Most Developers Fear Git

You use Git every single day — commit, push, pull. It works... until it doesn't. And then you're googling "how to undo git rebase" at 11 PM, mass copying commands from Stack Overflow, praying you don't make it worse.

For years, I struggled with Git, memorizing commands without understanding what they actually did. Then I learned the mental model—and everything clicked.

The Mental Model Approach

Instead of memorizing commands, we'll learn the mental model that makes Git intuitive. Once you understand what's actually happening, commands become obvious, recovery becomes easy, and fear disappears.

📸

Snapshots

Git stores complete snapshots, not diffs

📝

Sticky Notes

Branches are just pointers to commits

🗺️

The Graph

Commits form a directed acyclic graph

What You'll Learn

  • What a commit actually is (hint: it's not a diff)
  • Why branches are "free" in Git
  • The difference between checkout, reset, and revert (and when to use each)
  • What rebase actually does (and why you should never rebase shared commits)
  • How to recover from almost any Git disaster

The graph above shows a simple Git repository.
Let's start by understanding what those circles actually represent.

Built with React, TypeScript, and a lot of Git knowledge.
Based on the principle that understanding beats memorization.