Reference · living document
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.
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)..git directory: every committed snapshot, every branch pointer, all of history. Deleting it deletes the history while leaving your files.git status under "Untracked files" and is otherwise ignored — never committed, never affected by branch switches.| Command | Moves | Effect |
|---|---|---|
git add <file> | working → staging | Copies current content into the next-commit draft. |
git commit | staging → repository | Writes the staged draft into history permanently. |
git status | reads all three | Reports which tree each changed file is sitting in. |
git diff | working vs. staging | What you have not staged yet. |
git diff --staged | staging vs. last commit | What you are about to commit. --cached is a synonym. |
git restore --staged <f> | repository → staging | Unstages: drops the file from the draft, keeps your edits on disk. |
| CLI concept | VS Code Source Control |
|---|---|
| unstaged + untracked changes | Changes group |
| staging area | Staged Changes group |
git add | + on a file row |
git restore --staged | − on a staged row |