skipnothing/Git
UNIT 02

Everyday Git

Staging, tracking, history, and setting aside work

Now that you know what git stores, these commands make sense, staging, ignoring, searching history, and setting work aside.

Loading…
BUILDS ON
TOPICS
#4

The Staging Area

Track one file across the working tree, `.git/index`, and your last commit, decode the two columns of `git status`, stage a single hunk with `git add -p`, and know what `.gitignore` can and cannot untrack.

Edit `config.json`, run `git add`, then change one line again, and your next commit keeps the earlier version, not what sits on disk. Three copies of one file exist at once, and one command chose between them.

12 min
#5

Reading History

Reconstruct every `git log`, `git diff`, `git blame`, and `git grep` result by hand as a walk over the commit snapshots, and see why re-reading history never adds a byte to `.git/`.

You scroll `git log` and picture git reading a stored list of what happened, but nothing is stored. Each line was recomputed a breath ago by walking your commits, and recomputed again the next time you look.

10 min
#6

Tags & Releases

Pin a release to one commit with a tag that never moves, choose lightweight or annotated by the metadata it stores, read what each writes to `.git/refs/tags/` and `.git/objects/`, decode the `git describe` string, and number releases with semantic versioning.

You shipped `app.py` at the commit everyone now runs, then kept committing on top. Weeks later you need that exact snapshot back, and one small file, written once and never rewritten, still points straight at it.

10 min
#7

Stash & Worktrees

Stash edits into the two-parent commit git writes under `.git/refs/stash`, restore them with apply (keeps the entry) or pop (erases it), and open a second `git worktree` that shares one object store while keeping its own HEAD and index.

You're mid-edit in `app.py` when a teammate pings: their fix needs the working tree clean right now. You don't want a half-baked commit, and you don't want to lose the last hour of work.

10 min
UNLOCKS
All units