Reference · living document

Git Glossary

The canonical definitions used across every lesson in this workspace. Git overloads ordinary words; when a lesson says "staging area", it means exactly what is written here.

The three trees

working directory
The project folder as it exists on disk right now. The only tree your editor sees or edits. Also: working tree.
staging area
A draft of the next commit, assembled deliberately with git add. Holds a copy of file content, taken at the moment you staged it — not a live pointer to the file. Also: the index, the cache (hence --cached).
repository
The .git directory: every committed snapshot, every branch pointer, all of history. Deleting it deletes the history while leaving your files.

File states

tracked
A file that was in the last snapshot, or has been staged. Git watches it for changes. Each tracked file is unmodified, modified, or staged.
untracked
A file Git has never been told about. It appears in git status under "Untracked files" and is otherwise ignored — never committed, never affected by branch switches.
snapshot
What a commit stores: the full state of every tracked file at that moment. Git records snapshots, not diffs — the diffs you see are computed on demand by comparing two snapshots.

Commands, by which trees they touch

CommandMovesEffect
git add <file>working → stagingCopies current content into the next-commit draft.
git commitstaging → repositoryWrites the staged draft into history permanently.
git statusreads all threeReports which tree each changed file is sitting in.
git diffworking vs. stagingWhat you have not staged yet.
git diff --stagedstaging vs. last commitWhat you are about to commit. --cached is a synonym.
git restore --staged <f>repository → stagingUnstages: drops the file from the draft, keeps your edits on disk.

CLI ↔ VS Code

CLI conceptVS Code Source Control
unstaged + untracked changesChanges group
staging areaStaged Changes group
git add+ on a file row
git restore --staged on a staged row