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 for risky or alternative attempts
card 5 of 6
Merge the winner, delete the other
builds on: Branches as parallel lines of work, Commit before every task: checkpoints
You merge from `main` because a merge brings commits into the branch you are on. `main` has not moved since `try-batch` started, so git simply moves `main`'s pointer forward to `try-batch`'s latest commit. `Updating` shows the old and new commit. This is a fast-forward. `-d` deletes only a branch that is already merged, so it works for `try-batch`. Git would refuse `-d` for the unmerged `try-cache` to protect you, so dropping that attempt on purpose takes `-D`.
$ git switch main
Switched to branch 'main'
$ git merge try-batch
Updating 1a2b3c4..9e8d7f6
Fast-forward
src/report.py | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
$ git branch -d try-batch
Deleted branch try-batch (was 9e8d7f6).
$ git branch -D try-cache
Deleted branch try-cache (was 3f2a9c1).
Terms on this card
- branch
- A named, movable pointer to a line of commits. New commits move the pointer of whichever branch is checked out.
- `main`
- The usual name of a project's primary branch: the line of work you treat as the good, current version.
- commit
- A saved snapshot of your project's tracked files, with a message. You can return to it later.
- pointer
- A label that refers to one specific commit. A branch is a pointer that moves forward as you commit.
- merge
- Bringing the commits of another branch into the branch you have checked out.
Lesson goal: Put a risky change or a second approach on its own branch so main stays clean. Compare the two attempts and merge or delete the branch. ·
the whole lesson