Objective & prerequisites
Explain a branch, review a change and merge only the intended work. 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
A branch is a movable reference to a commit. It is not a complete independent copy of every file. Branching helps isolate a coherent change, but tests and human review still establish whether the change is suitable. Pull requests add a collaboration/review workflow on a hosting service; a local merge does not create one.
Worked example
The reference branches feature/validation from main, commits a control-total note and fast-forwards main to that exact commit. It checks the commit identity after merging. This is a local Git demonstration, not a GitHub account integration or published pull request.
git switch -c feature/validation
# Edit only your disposable practice files.
git diff --cached
git merge --ff-only feature/validationTry it yourself
Draw the two-commit history before and after the fast-forward. Write a mock pull-request description explaining the problem, change, evidence and limits without actually posting it. Record your prediction before running the supplied reference, then compare the observed result and explain any difference.
Worked solution
Before merge, feature/validation points to the second commit while main points to the first. A fast-forward moves main to the second commit; there is no new merge commit. The review should identify the checked 70000-cent control and disclose fictional data.
Knowledge check
Does a branch name prove a change was reviewed? Try answering without rereading the example.
Check and explain
No. A name records neither test evidence nor approval. Review the diff and actual checks.
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.