Objective & prerequisites
Create an inspectable local change history without publishing anything. Prerequisites: basic Python expressions and files; use a disposable local practice folder and fictional data. This shared workshop complements the existing data/AI tracks and does not create a second progress system.
Understand the concept
Git records snapshots of selected content. The working tree is what you are editing; the index is the proposed next snapshot; a commit identifies a recorded snapshot and its parents. A file existing on disk does not mean it is tracked. Review staged changes before committing. A remote repository is a separate sharing destination, not required for local history.
Worked example
The reference creates a temporary repository, adds only README.txt and .gitignore, then records a scoped brief. Its fake .env is intentionally ignored. No global configuration, network remote or production repository is changed.
git status
git diff
git diff --cached
git log --onelineTry it yourself
Run the Git unit test. Explain why git diff and git diff --cached can show different changes. Add an extra fictional note only in your own disposable repository. Record your prediction before running the supplied reference, then compare the observed result and explain any difference.
Worked solution
The first commit contains two named files and excludes .env. git diff compares unstaged edits; --cached compares staged changes with the last commit. Inspect git status before each operation. An ignored file already committed would require a separate reviewed remediation; .gitignore does not erase history.
Knowledge check
Does adding a filename always commit its latest future edits? Try answering without rereading the example.
Check and explain
No. git add stages a snapshot at that moment; later edits need another deliberate stage and review.
Mini-project, mistakes & handover
Produce a short README with the question, exact local command, input meaning, checks and actual results. Include one failure case and its explanation. Never silently turn an exception into a passing result. Mark simulated behavior explicitly, credit the supplied teaching code and identify your own contribution. These activities are unsaved self-practice, not certification.
Authoritative reference
— consulted for the underlying interface/concept. The lesson and fictional examples are original teaching material. Python reference tested with 3.12; designed for 3.10+. Git lab requires Git 2.28+.
Try the activity before reading its reference. Keep your sources, commands and assumptions with your work. Companion activities are unsaved self-practice and do not award a certificate or change lesson progress.