DAY 05 of 12
History & packaging
Time-machine your code and pin your dependencies so it runs anywhere
You can do… by end of day
- Commit with
git status → add → commit, undo at every level, and work with branches. - Merge a branch and resolve a simple conflict.
- Isolate a project in a
venvand handle errors cleanly. - Install and pin software with
apt/pipso the same build runs on any machine.
Deliverable
A git repo with a clean, readable history + a venv that reproduces the project anywhere.
Big-picture hook
Your code now has a history, and your dependencies are reproducible. Time to box the whole stack and put a real door in front of it.
Concepts what you'll understand
- Git, the time machine: the working tree, the index, commits;
status → add → commit; readinggit log. - Branches & merge: why a branch, merging, and the (non-scary) conflict.
- Levels of undo:
git restore,git reset --soft/--mixed/--hard, and recovering a “lost” commit. - venv & packaging: a virtual environment per project;
pip install -r requirements.txt; why you pin. - Package managers as an app store:
apt(system),pip(Python) — and how an install actually works. - Clean Python: modules, error handling (
try/except), and the patterns for tidy Flask code.
The lab hands-on, ends with something live
- First commit: init a repo, make a meaningful commit, read the log.
- Undo lab: make a mess, then undo it at every level until the history is clean.
- Branch & merge: create a branch, commit to it, merge back, and resolve one conflict.
- Venv + pin: create a venv, add a dependency, pin it to
requirements.txt, and rebuild from scratch.
Want this in another format? All formats