Tools & Workflow
A Practical Introduction to Git and Version Control
Git from first principles — the mental model, the everyday commands, branching, merging, undoing mistakes, and a sane workflow.
Updated 2026-07-12 · 7 min read
Git feels intimidating because most people learn it as a list of magic incantations. You memorize git commit, git push, and a rescue command you found on the internet, and you hope nothing goes wrong. But Git is far less scary once you understand the small model underneath it. Almost every command becomes obvious once you can picture what it's doing.
This guide builds that mental model first, then walks through the commands you'll use every day, and finishes with how to undo things safely — because undoing mistakes calmly is what separates comfortable Git users from anxious ones.
The mental model
Git tracks snapshots of your project over time. Each snapshot is a commit — a complete picture of your files at a moment, plus a message and a pointer to the commit that came before it. Chain those pointers together and you get history.
There are three places your work lives:
- Working directory — the actual files you edit.
- Staging area (index) — a holding zone for changes you've marked as ready to commit.
- Repository — the committed history, stored in the hidden
.gitfolder.
The staging area is the part beginners skip, and it's the key to good commits. It lets you choose exactly which changes go into the next snapshot, so a single commit can be one clean idea instead of a dump of everything you touched.
edit files → git add → staging area → git commit → repository
(working dir) (index) (history)A commit is identified by a hash like a1b2c3d. A branch is just a lightweight, movable label pointing at a commit. HEAD is a pointer to wherever you currently are. That's the whole core.
Getting started
Set your identity once, then create or clone a repository.
git config --global user.name "Your Name"
git
