Go from never having used a coding agent to working productively and safely with one. The learner should understand what an agent is and how it differs from a chat assistant. They should choose a tool, set up a protected first project, describe tasks the agent can do well, and follow and verify its work. They should recover from bad changes, manage context, and plan bigger changes. They should also use tests as the definition of done and run everyday workflows (bug fixes, features, writing tests, codebase exploration, scripts, small tools, refactors). Throughout, they should keep secrets and systems safe and keep their own understanding growing instead of outsourcing it.
Git commits as snapshots you can return to
card 5 of 6
Why a recent commit works as an undo button
builds on: Terminal basics: where you are and running things
The agent edits `report.py`, adds `charts.py` and deletes `old_utils.py`. Now the report page crashes. Commit `3f2a9c1` is untouched. git can put every file from that snapshot back exactly as it was, `old_utils.py` included. `charts.py` was never in the snapshot, so it shows up as a new file you can delete. A later lesson shows the exact commands.
Limits: a commit protects only the files it contains, as they were at that moment. Files outside the project root and files never added are not saved. The snapshot lives in `.git`, so if `.git` is deleted, your undo is gone too.
Terms on this card
- git
- A program that records the history of a project folder as a series of saved snapshots you can look at or return to.
- `.git`
- Hidden folder inside the project root where git stores all commits and settings. Deleting it deletes the history.
- commit
- A saved, unchangeable snapshot of all tracked files in a repository, with a message, author, time and unique id.
- project root
- The top-level folder of your project, the one containing `.git`.
- agent
- An AI tool that doesn't just chat. It reads your project's files, edits them and runs commands to carry out a task you give it.
Lesson goal: Explain a repository, the staging area and a commit as a saved snapshot of the whole project with a message. Explain why a recent commit works as an undo button for anything an agent does afterwards. ·
the whole lesson