Level 6 — Real-world simulation: one sprint at Northwind Trails
Advanced
Objective
Everything so far has practised one thing at a time. This lab is a sprint: two pieces of planned work, one urgent interruption, one conflict, and a release at the end. You play the whole team, which is artificial, and the sequence is exactly what a real week looks like.
Set aside ninety minutes. It is worth doing in one sitting, because the point is the shape of the whole thing.
Starting state
- Your own project with the playground pushed, from Lab 2, and
mainprotected (lesson 9.5 or lesson 10.5). - A pipeline that runs on merge requests: the playground ships one.
- A second clone, playing your colleague Ben, as in Lab 4.
- The better conflict markers on:
git config --global merge.conflictstyle zdiff3.
Day 1: plan
- File two issues, properly (lesson 13.9):
- #31 "Installation guide is missing the Windows steps" — say where, and what a Windows user should see.
- #32 "FAQ licence answer is ambiguous" — quote the current sentence and say what is unclear.
- Label them
documentation, and put both in a milestone calledv1.3.0. - Assign #31 to yourself. Leave #32 unassigned; Ben will take it.
- From issue #31, create a branch through the platform, then fetch and switch to it locally.
Day 2: the feature branch
-
Update first, then confirm you branched from current
main:Terminal $ git switch main && git pull $ git switch docs/31-windows-install-steps -
Write the change in
docs/getting-started.md: a Windows section with two or three real steps. -
Commit deliberately. Read the diff, stage, read the staged diff, commit:
Terminal $ git add docs/getting-started.md $ git diff --staged $ git commit -m "docs: add Windows steps to installation guide (#31)" -
Break the pipeline on purpose: add a heading that skips a level, for example
####directly under##. Commit that too, as a separate commit. - Push and open a draft merge request with what, why, how to check, and
Closes #31.
Day 2, later: the red pipeline
- Read the failure properly (lesson 14.3): open the failing job, go to the end of its log, and find the line naming the file, the line number and the rule.
- Fix it and push. Watch the pipeline go green.
-
Tidy the branch before review, since nobody else has it:
Terminal $ git rebase -i mainMark the fix commit
fixupso it merges into the first, leaving one clean commit. Then:Terminal $ git push --force-with-lease -
Mark it ready and request a review.
Day 3: the review
- In the second clone, as Ben: check out your branch, read the change, and leave one batched review with a suggestion for a wording change and one question (lesson 13.7).
- As yourself: apply the suggestion, answer the question in the thread, and resolve it.
- Do not merge yet. Leave it approved and waiting.
Day 3, meanwhile: the conflict
- As Ben, take issue #32: branch from
main, rewrite the licence answer indocs/faq.md, commit, push, and merge that merge request intomain. - As yourself, on your branch, rewrite the same sentence differently, commit, and push.
-
Update your branch from
main. The conflict appears:Terminal $ git fetch $ git rebase origin/main -
Resolve it properly: read all three versions, and write a sentence that says what both of you meant (lesson 11.3). Then:
Terminal $ git add docs/faq.md $ git rebase --continue $ git push --force-with-lease -
Merge your merge request, with squash and delete-source-branch, and confirm issue #31 closed itself.
Day 4: the interruption
-
Tag what is on
mainas the released version, and push the tag:Terminal $ git switch main && git pull $ git tag -a v1.2.0 -m "Release 1.2.0" $ git push origin v1.2.0 -
Add two ordinary commits to
main, playing the rest of the team continuing to work. -
A bug is reported in production. Branch from the tag, not from
main(lesson 13.2):Terminal $ git switch -c hotfix/33-wrong-region-name v1.2.0 -
Make the one-line fix, commit, push, and open a merge request onto a
release/1.2branch cut from the same tag. - Get the same fix onto
mainas well, by cherry-pick with-xor a second merge request. Confirm withgit log --oneline main | head -3that it is there. - Tag
v1.2.1on the release branch and push it.
Day 5: the release
-
Work out what shipped:
Terminal $ git fetch --tags $ git log --oneline v1.2.0..main -
Write the changelog entry for
v1.3.0inCHANGELOG.md, with Added and Fixed sections, in the user's words (lesson 13.6). - Decide the version number from those entries, and say why in one sentence.
- Tag and release: create the tag, push it, and create the release page with your notes and the milestone attached.
-
Clean up:
Terminal $ git switch main && git pull $ git fetch --prune $ git branch -d docs/31-windows-install-steps
Expected result
- Two issues closed by their merge requests, and one hotfix issue closed separately.
maincontaining one clean commit per piece of work.- A
release/1.2branch with the hotfix, and tagsv1.2.0,v1.2.1andv1.3.0. - A release page whose notes a user could act on.
- A local repository with no stale branches, and nothing uncommitted.
If something goes wrong
| Symptom | Where to look |
|---|---|
| The pipeline fails for a reason you did not cause | Lesson 14.3, and check whether main is red too |
| The rebase conflicts repeatedly | git rebase --abort and merge instead (lesson 12.6) |
| The force push is refused as "stale info" | Fetch and look: something arrived on your branch (lesson 12.8) |
| The issue did not close | Closes #N was missing or misspelled; close it by hand |
| The hotfix contains more than the fix | It was branched from main rather than the tag; redo step 24 |
| You are lost | git status, git log --oneline -5, git reflog (lesson 12.10) |
What you learned
The individual commands were all in earlier labs. What this one adds is the order, and three things that only appear when the work is realistic:
- The pipeline fails at an inconvenient moment, and reading the log properly is faster than guessing.
- Someone else changes the same sentence, and the resolution is usually neither version.
- The urgent thing arrives mid-sprint, and where the hotfix branches from is the only decision that matters.
If you can run this lab unaided, you can work on a real team's repository without anyone needing to explain the process to you.
Next
The reference section is what you use from here: the decision guides when you are unsure, the cheat sheets while the commands are new, troubleshooting when something breaks, and the checklists at the moments that repeat.