At the end of the last lesson, you had two branches, each with one reviewed commit: issue-1-search, where search ignores capitalization, and issue-3-found-where, where each search result says where the item was found. Both start from the same commit on main, and neither change is on main yet.
Each branch passed the tests in its own folder, where you ran them yourself, but nobody has run them with both changes in one place. Separate files can still affect each other when the app runs, so you merge one branch at a time, rerun the tests after each merge, and check the page once both are in.
Key Points
- Merging brings a branch’s commits into the branch you’re on. So you work in the
lost-propertyfolder, on themainbranch. Rungit switch mainfirst to be sure. - A fast-forward moves
mainforward. Whenmainhas no new commits since the branch started, Git movesmainto the branch’s commit. - A merge commit joins two lines. Once
mainhas a commit the branch doesn’t have, Git makes a merge commit instead. The--no-editoption keeps Git’s suggested message rather than opening your editor for one. If an editor does open for the message, save and close it to keep Git’s message. - Rerun
npm testafter each merge. After the second merge, the tests run with both changes together for the first time. Your commit IDs and test count will differ from the video’s. Check forfail 0. - Check the page once on
main. The tests cover search, but not how the results page shows an item. Start the server onmainand search for “Fiddle” with a capital F. The capital F working is issue #1’s fix, and the location in each result is issue #3’s. - Remove the worktrees once their branches are merged. Stop the server with Ctrl+C and exit each folder’s agent session first. The commits are already on
main, sogit worktree removedeletes only the folder, and the branches stay.git worktree listthen shows one folder, onmain. - If
git worktree removerefuses, read what’s left. It refuses if the folder still has changes you haven’t committed. If it does, rungit statusin that folder and read what it lists. Discard leftovers before you try again. Anything worth keeping there isn’t onmainyet. Use--forceonly when you’re sure nothing there is needed. - The review queue sets the pace. Two agents worked at the same time, but each merge waited for your review and your test run.