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.
Branches as parallel lines of work
card 5 of 6
The happy path in the terminal
builds on: Git commits as snapshots you can return to
After the first command the agent edits the files, then you save its work in a commit. The experiment worked. While you were away, `main` gained no new commits, so the merge is a **fast-forward**: git just slides the `main` note forward to the branch's commit.
$ git switch -c try-sqlite
Switched to a new branch 'try-sqlite'
$ git add .
$ git commit -m "Store notes in SQLite"
[try-sqlite 9b7e4d2] Store notes in SQLite
$ git switch main
Switched to branch 'main'
$ git merge try-sqlite
Updating 3f2a1c0..9b7e4d2
Fast-forward
$ git branch -d try-sqlite
Deleted branch try-sqlite (was 9b7e4d2).
Terms on this card
- branch
- A named pointer to one commit. It moves forward each time you commit while on it, so it marks the tip of a line of work.
- `main`
- The usual name of the first, default branch in a repository. Some older projects call it `master`.
- commit
- A saved snapshot of the whole project with a message, which you can return to later.
- merge
- Bringing the commits from another branch into the branch you are currently on, using `git merge <name>`.
- fast-forward
- A merge where the current branch has no new commits of its own, so git just moves its pointer forward. No new commit is created.
Lesson goal: Explain a branch as a movable pointer to a line of commits. Create one for an experiment, switch between branches, and merge or delete it depending on how the experiment went. ·
the whole lesson