Git: A Mental Model for Version Control

Software
Git
Version Control
Learn commits, branches, merge, rebase and recovery by thinking of Git as a graph rather than memorizing commands.
Author

MLStation

Published

October 1, 2026

Git becomes much easier when you stop treating it as a bag of commands.

Think of it as a graph of snapshots.

TipKey ideas

repository working tree staging area commit branch HEAD merge rebase remote fetch pull push

The three places

Working directory
      │ git add
      ▼
Staging area
      │ git commit
      ▼
Repository history

A basic rhythm:

git status
git add analysis.py
git commit -m "Add bootstrap analysis"
git log --oneline

Best resources

Pro Git — free official book:
https://git-scm.com/book/en/v2

Git Reference:
https://git-scm.com/docs

Learn Git Branching — visual and interactive:
https://learngitbranching.js.org/

GitHub’s Introduction to Git:
https://github.com/skills/introduction-to-git

Practice visually

Use Learn Git Branching to see:

A──B──C  main
    \
     D──E  experiment

Commands such as merge and rebase make far more sense when you can visualize the commit graph.

WarningGit is also a recovery system

Before using destructive-looking commands copied from the internet, understand what will happen to the working tree, index and commit graph. git status is your friend.

Next: GitHub — Collaboration, Pull Requests & Portfolio

Back to top