Instructor Notes
This page is for the people running the workshop. It covers what to prepare, a run-sheet for each day, the solutions and how to rescue someone who is stuck, and how to maintain the lesson. Each episode also has an Instructor view box with its own timings, common problems and a bridge to the next episode.
Before the workshop
About a week before
-
BASH
cd build/peakfinder git remote add origin <the public course repository URL> git push origin main background-subtraction colleague/normalise-modes untangle --tagsThe repository must be public (so learners can fork it). Then put its URL in
learners/setup.md.
If you don’t use rebase yourself yet. Many instructors don’t, and that’s fine. Before teaching it, do the exercises in episodes 5, 6 and 7 once on your own computer (about an hour), and practise the rescue commands. Everything in the lesson is safe, because of the backup branch and the reflog.
Day 1 run-sheet
Times assume a 09:00 start and a 15-minute break after episode 4. They come from each episode’s own “teaching + exercises” times, so they leave about 44 minutes of slack (end 12:16). Follow-along sessions usually run over by a third, so treat the slack as spent.
| Start | Episode | Check before moving on | If you’re behind, cut |
|---|---|---|---|
| 09:00 | 01 Welcome and the Story (15 min) | Everyone is on main with a clean
git status; git branch -r shows the other
branches and git tag shows v0.1.0 and
v0.2.0; pytest passes; git push
works; partners are collaborators on each other’s forks. |
Shorten the collaborator-invite walkthrough (email it beforehand). |
| 09:15 | 02 A Mental Model: Snapshots and Labels (22 min) | Nothing to check. Ask: “what does a branch point at?” | Skip the git hash-object check. |
| 09:37 | 03 Planning and Atomic Commits (23 min) | Everyone has written down their list of commits. They need it for episode 6. | Collapse the prefixes callout; shorten the example. |
| 10:00 | 04 The Safety Net: Reflog (15 min) | Everyone ends on main with a clean
git status (no leftover experiment branch or
README edits). |
Skip the knowledge check. |
| 10:30 | break back (15 min) | ||
| 10:30 | 05 Shaping a Commit: Staging, Amend, Reset and Restore (27 min) | The untangle branch has two new
commits (--title, then the markers), no DEBUG
print, and pytest passes. |
Skip the git add -p callout and the reset knowledge
check. |
| 10:57 | 06 Interactive Rebase: Rewriting a Messy Branch (43 min) |
background-subtraction has seven clean
commits; main is unchanged and nobody merged the
branch. |
Don’t cut. If behind, give out the finished todo from the solution earlier. |
| 11:40 | 07 The Daily Loop: Fixup and Autosquash (36 min) | A feature branch (feature-prominence or
feature-widths) is pushed to the fork,
with three clean commits and no fixup!; main
is unchanged. |
Learners watch the short demo instead of typing it. |
Day 2 run-sheet
A 15-minute break after episode 11. End 12:15, leaving about 45 minutes of slack.
| Start | Episode | Check before moving on | If you’re behind, cut |
|---|---|---|---|
| 09:00 | 08 Day 2 Recap and Warm-up (9 min) | State check passed: clean tree, feature branch present on the fork. Standing rules said aloud (own fork; Rebase and merge). | Skip the quiz; do the state check only. |
| 09:09 | 09 Rebase vs Merge, and Resolving Conflicts (35 min) | Feature rebased onto main (straight line), pushed with
--force-with-lease, and one test still
fails (the colleague’s). Nobody typed the merge demo. |
Skip the merge demo (the diagrams show the double back). |
| 09:44 | 10 Tracking Down a Bug: Blame and Bisect (30 min) | The fix is on main (fast-forwarded and pushed), the
feature is rebased onto it, and all tests pass. |
Skip the by-hand bisect demo, then the log -S/-L
callout. |
| 10:14 | 11 Pull Requests: Authoring and Reviewing (30 min) | A pull request is open on the learner’s own fork (not the course repo), reviewed by the partner, and a fixup pushed. Finishing is optional. | Skip the Finishing section (squash and merge). |
| 10:59 | break back (15 min) | ||
| 10:59 | 12 Catching Problems Early: Shift Left and CI (26 min) | Actions enabled; the add-ci pull request has gone
green, then red, then green again (or the fallback demo has been
shown). |
Do the exercise as a demo, or use the fallback. |
| 11:25 | 13 Releases: Versions, Tags and Cherry-pick (35 min) |
release/0.2 and tag v0.2.1 pushed, with
the fix cherry-picked. |
Skip the optional GitHub release. |
| 12:00 | 14 Tooling and Wrap-up (15 min) | Each person has named one habit to try. | Read-afterwards: do only the take-aways. |
The standing rules for day 2 (said once, in episode 8): every pull request is on the learner’s own fork, and you merge with Rebase and merge.
Solutions
Every exercise has a solution box in the episode. The ones people most often need:
| Exercise | Where the answer is | End state to check |
|---|---|---|
| 03 smell test | the solution box (a 7-commit list) | learners wrote their own list |
| 05 untangle | the solution box (VS Code and command line) |
git log --oneline -3 shows two new commits;
git grep DEBUG is empty |
| 06 rebase 1 and 2 | the solution boxes give the finished todo lists |
git log --oneline main.. shows seven commits;
git diff --stat backup/background-subtraction shows only
scratch_smoothing.py
|
| 07 features A/B | the solution box | three commits, no fixup!, pytest
passes |
| 09 rebase and conflict | the solution box gives the resolved
find_peaks for A and B |
straight line, one failing test left |
| 10 the fix | the solution box |
pytest passes after the second rebase |
| 12 CI | the solution box, and the workflow file in the episode | green, red, then green |
| 13 release | the solution box | tag v0.2.1 on release/0.2
|
Rescuing someone who is stuck
First, the general tools, which cover most problems:
-
git statussays what git thinks is happening and what to do next. -
git rebase --abort(orgit merge --abort,git cherry-pick --abort) puts everything back. -
git reflogfinds a lost commit (episode 4). -
git reset --hard origin/<branch>puts a branch back to what’s on their fork. Use it with care: it throws away local changes.
For specific exercises, helpers need the solutions repository as a remote:
| Problem | Rescue |
|---|---|
| Episode 6: badly tangled, no backup |
git switch -C background-subtraction origin/background-subtraction
starts again from the messy branch. Or, to give them the
finished branch:
git switch -C background-subtraction solutions/solution/background-subtraction
|
| Episode 7: a lost feature branch |
git switch -C feature-prominence solutions/solution/feature-prominence
(or feature-widths) |
| Episode 9: stuck in the conflict |
git rebase --abort, then redo it, pasting the resolved
find_peaks from the episode’s solution box |
| Episode 10: missed the fix |
git switch main, then
git cherry-pick solutions/solution/fix-normalise
|
Their main has stray commits |
git switch main, then
git reset --hard origin/main (check
origin/main is the right one) |
| No tags in their fork | They ticked “Copy the default branch only”. Re-fork with it
unticked, or
git fetch <original repository URL> --tags
|
| Pull request opened against the course repository | Close it, and open it again on their own fork |
Online delivery
- Put people in pairs in breakout rooms for the exercises, and have helpers visit the rooms. Create the rooms before you need them, and keep a list of who is with whom.
- Share your VS Code with the terminal visible, at a large font, as people follow your commands.
- Use the chat for “done” reactions after each step, so you can see who is behind without stopping.
- Pairs that lose a partner can review the prepared pull request (episode 11) and follow the prepared Actions run (episode 12).
Looking after the lesson
-
Rebuild the example repository with
python tools/build_starter.py --force. It checks that the tests pass and fail where the episodes expect, that the example features conflict with the colleague’s work, and that the fix cherry-picks cleanly. -
Any change under
tools/changes every commit hash, even a name or a date. After a rebuild, runpython tools/remap_hashes.py <old hashes file>to update the hashes quoted in the episodes (the steps are in its docstring). -
Check the diagrams with
node tools/check_diagrams/check.mjs(add--render <folder>to draw images). It needsnpm installonce. -
Check the lesson with
sandpaper::validate_lesson(".")in R, and preview it withsandpaper::serve().
Welcome and the Story
Instructor Note
Timing. 10 minutes talking, 5 for the discussion. If the setup check turns up problems, give helpers the stragglers and keep going. Don’t let the whole room wait for one laptop.
The hook. Put the two logs up side by side. Don’t tell people which is “right”. Let them say it. Then say “The code is identical.” That is the idea of the whole workshop.
Noisy plot. Make sure everyone has seen the 71. In episode 7 they’ll write a feature to fix it, and it helps them to care.
Collaborator invitations. This is where people get stuck: the invitation sits in an email, and the invitee must accept. Check that pairs have done it now. On day 2, PR review needs it.
Common setup problems (see the setup page for fixes):
- forked with “Copy the main branch only” ticked (so only
main, no tags): delete the fork and fork again - no way to
git push(authentication) -
core.editornot set, so the rebase editor will be vim - virtual environment not active, so
pytestis not found
Online. Drop the list of pairs in the chat, and create the breakout rooms before they’re needed. Have a helper in every room if possible.
Pairs with an odd number. A trio works: one person is the reviewer for the next.
A Mental Model: Snapshots and Labels
Instructor Note
Keep this brisk (about 25 minutes). The goal is a useful
model, not a complete one, and people may ask about trees, blobs or
packfiles. Park those and point them at the extras. If you want a deeper
treatment (optional, end of day 2, or the learner reference), the deep
dive is: objects (blobs, trees, commits, tags), content addressing,
git hash-object, .git/objects.
Likely questions:
- “So git doesn’t store diffs?” Conceptually it stores snapshots. Under the hood it is clever about storing them compactly (packfiles), but you don’t need to care.
- “What if two commits have the same content?” Different parents or timestamps mean different hashes.
- “Can I see the old commit later?” Yes, that’s the next-but-one episode (reflog).
Planning and Atomic Commits
Instructor Note
Timing: about 15 minutes of talk and 10 for the challenge. The challenge is reading only, in pairs, and we reuse the plan in episode 6. Keep it light: don’t spend long on commit message conventions, people have strong opinions and it is a rabbit hole. Show the table of “weak vs better” and move on.
Possible discussion points:
- “Should tests go in the same commit as the code?” There are two schools of thought. Our view: yes, if a commit changes behaviour, the test for it belongs with it, so every commit stands alone. But a separate test commit is fine, and our messy branch has one.
- “This is too much work.” Answer: you will write less time worth of commit message than you save in review. And episodes 5 to 7 show how to get there without planning perfectly.
- “What about squash merging? Doesn’t that make this pointless?” Squash is a good fallback when a branch has not been curated, but it throws away exactly the story we’re trying to tell. We’ll come back to this in episode 9.
Make sure everyone writes the plan down (a text file or paper). They’ll need it in episode 6.
The Safety Net: Reflog
Instructor Note
Pacing. This episode is the follow-along: learners type every step with you, so go slowly and pause after each command until people have caught up. There’s no separate challenge. If someone falls behind, they can watch and catch up at the knowledge check.
Do the “oh no” moments as a live demo with everyone following. The drama is the point: say “I’ve lost all my work!” and pause before looking at the reflog.
Cleanup: make sure everyone ends the episode with main
checked out, and with a clean git status. A bad
README.md change left on main would cause
confusing conflicts later. If anyone committed to main by
mistake: git reset --hard origin/main (they have a fork, so
it will be at the right place).
VS Code has no built-in reflog view. (The GitLens extension adds one.) This is a terminal job.
Common problems:
- The reflog opens in a pager and people don’t know how to leave. It’s
q. - Someone runs
git reset --hardwith uncommitted work, and asks about it. Use it as the live demonstration of “what the reflog can’t save”.
Shaping a Commit: Staging, Amend, Reset and Restore
Instructor Note
Demo first (about 5 minutes). Do the first hunk of
the challenge live in VS Code, so people see Stage Selected
Ranges working: undo the commit, stage the lines about
--title in cli.py, and show the file in both
the Staged and the Changes lists. Then leave the rest
to them.
Things that go wrong:
- “Stage Selected Ranges” is greyed out. They selected lines in the left (old) side of the diff or nothing at all. It has to be the right-hand side.
-
They stage the whole file by clicking
+. They can unstage it again with-, or Unstage Selected Ranges for a part. -
They commit the debug print and then need to remove
it. Fine: it’s a chance to show
git commit --amend, orgit reset HEAD^and again. - They discard something they wanted with Revert Selected Ranges. If it was committed, the reflog has it. If not, it’s gone. Use it as a reminder of episode 4.
-
VS Code shows no
...menu or Amend option: an older VS Code. Use the command line.
Don’t skip the debrief (3 minutes). Ask: “How did you decide which lines go in which commit?” The answer, “by the idea they belong to”, is the skill.
The untangle branch is built by
tools/build_starter.py, and is the same for everyone.
Interactive Rebase: Rewriting a Messy Branch
Instructor Note
Pause here until everyone has five commits. The commonest problems are:
- The editor opened in vim (not VS Code), so
core.editorwasn’t set. Fix it withgit config --global core.editor "code --wait". If they are stuck in vim::q!aborts the rebase step. - Typing in the wrong order. Remember it’s oldest first.
- Saving the file but not closing the VS Code tab. Git waits until the tab is closed.
- A commit moved above one that touches the same file, and a conflict.
They can
git rebase --abortand start again, with the todo list given in the solution.
Instructor Note
Give people about 10 to 12 minutes, then review it together. Live-demo the solution in the VS Code terminal while someone describes what they did.
Make sure nobody merges background-subtraction into
main at the end. Tomorrow, main has to be
unchanged so that the colleague’s branch can be fast-forwarded onto it
(episode 9). If anyone does, git reset --hard origin/main
on main puts it right.
Things that commonly go wrong:
-
Forgetting
git rebase --continueafter the split.git statussays “interactive rebase in progress”. -
git reset --hardinstead ofgit reset. The changes are gone from the working directory! Show them how to recover:git rebase --abort, then start rebase 2 again. -
Staged everything in one go, ending with a single
commit again. Check with
git show --stat. - A conflict in a reword step. This shouldn’t happen
in this exercise. If it does,
git rebase --abortand restart. -
Someone who is hopelessly lost: have them
git rebase --abort(if in a rebase), thengit reset --hard backup/background-subtraction, and go again from rebase 1. If they have no backup, a helper can give them the clean result (see the instructor guide for the rescue commands).
The Daily Loop: Fixup and Autosquash
Instructor Note
Demo (about 8 minutes, with learners following). It’s deliberately short: two commits, one docstring fixup, and the autosquash. People copy the code from the page, so the demo is about the git. The key moments to slow down for:
- Spotting the missing docstring, and the thought “this belongs to commit 1, not a new commit.” Say it out loud.
- The
fixup!commit at the end of the log, then the todo list with thefixupline already moved up under its commit. Pause here. People find this a pleasant surprise. - The log afterwards: no fixup, nothing to hide.
Save the time for the challenge, where they do it all themselves (and meet a bug that a test catches).
Challenge (28 minutes). Pairs: each person works alone on their own computer, but can ask the other. Online: breakout rooms of two.
Common problems:
-
git commit --fixupwith a wrong hash (or a hash from before an earlier rebase).git log --oneline main..and try again. If the fixup is wrong,git reset --soft HEAD^and redo it. - The test doesn’t fail. They fixed the bug while writing the helper. Tell them to paste the code exactly as written.
-
B: only one
>=fixed. The test still fails. Both loops need changing. -
Autosquash doesn’t reorder anything. They ran
git rebase mainwithout-i(no autosquash), or therebase.autoSquashsetting is missing. Usegit rebase -i --autosquash main. -
Editor doesn’t open or hangs.
core.editorisn’tcode --wait(see setup). -
A conflict during autosquash. Rare here.
git rebase --abort, and check the fixup only touches the lines it should.
Pushing: git push needs authentication
to work, which was part of the setup. If someone’s push fails, pair them
with a helper rather than losing time. They can still finish the
exercise locally, and push later.
End of day 1. Before finishing, check everyone has:
- a pushed branch (
feature-prominenceorfeature-widths) on their fork -
mainunchanged, and a cleangit status
Preview day 2: “Overnight, a colleague’s pull request gets merged into main. It touches the same function as yours…”
Day 2 Recap and Warm-up
Instructor Note
Keep this to about 10 minutes. The quiz can be done by a show of hands, or by cold-calling. Don’t let it turn into a lecture.
State check. The point is to find the people with a broken day-1 state before they hit episode 9. Common problems:
-
mainhas local commits, because they committed to it by mistake.git reset --hard origin/mainfixes it. - The feature branch still contains
fixup!commits, so they never ran the autosquash. They can do it now:git rebase -i --autosquash main. - They never pushed.
git push. - The fork is missing the colleague’s branch (they forked with the
default-branch-only option). Tomorrow’s story needs
colleague/normalise-modes. They can fetch it from the original repository (git remote add upstream <url>,git fetch upstream) and push it to their fork, but it’s often quicker to re-fork.
Fallback branches. Have a ready-made
feature-prominence and feature-widths
available for anyone who lost theirs. These aren’t published to the
learners’ forks, so give the helpers a way to hand them out.
Rebase vs Merge, and Resolving Conflicts
Instructor Note
Plan (about 35 minutes). Roughly: 10 minutes of
explanation with the diagrams, 5 to fast-forward main, 5
for your demonstration of the merge (conflict, merge
editor, graph, undo), 8 for the rebase challenge on their own, and 5 for
the push and the buttons. The merge is a demo: learners
watch and don’t type, so they resolve the conflict once, themselves, in
the rebase. If you’re running short, skip the demo: the diagram already
shows the double back.
The demo is where you teach the merge editor. Open it, explain the three panes, and say out loud “which side has the colleague’s change, and which has mine?” before clicking anything. Then they do the same, alone, in the rebase.
Roles swap in a rebase. Current and Incoming mean the opposite of merge. This catches everyone out. Spend a minute on the callout.
Common problems:
-
They click “Accept Current” or “Accept Incoming” on
a whole conflict and lose half of what they wanted. Check that the
result has both
Peak(...)and their new option (git diff mainshould show their feature).pytestwill also fail with aNameErrororTypeError. -
They leave the markers in
(
<<<<<<<).git diff --checkfinds them. -
They forget
git rebase --continue:git statussays “rebase in progress”. -
An editor tab opens after
--continue(it’s the commit message). Tell them to close the tab. If the editor isn’t set, they get vim; see the setup page. -
They run
git pullafter being told not to: have themgit reflogand reset, as in episode 4. A good chance to show it working. -
They use
--forcerather than--force-with-lease. Remind them. -
git merge --ff-onlyrefuses: theirmainhas commits of its own.git reset --hard origin/mainfirst (then redo the fast-forward). - The one failing test after the rebase isn’t a mistake: it is the hook for episode 10. Don’t explain it yet.
If someone is hopelessly stuck:
git rebase --abort, and give them the resolved
peaks.py from the solution, or have a helper pair with
them.
Bridge to episode 10: “We have one failing test, and it isn’t in our code. What changed?”
Tracking Down a Bug: Blame and Bisect
Instructor Note
Plan (about 30 minutes). Roughly: 3 for the failing
test and blame, 7 for bisect (you explain and show the by-hand version,
then they run bisect run), 15 for the fix, merge and
rebase. If it runs long, trim in this order: the by-hand demo, the
-S/-L callout, then the Knowledge check.
Bisect has two layers. Show the by-hand version
once, briefly, so the idea of “binary search” lands. Then learners only
type the three-line bisect run, which takes seconds.
No pull request here, by design. The fix goes
straight into main with a fast-forward, which keeps this
episode short and saves the pull request mechanics for episode 11. Say
out loud that a real team would open one.
Common problems:
-
git bisectrefuses, because of uncommitted changes. Stash or commit. -
They forget
git bisect reset, and wonder why they’re on a detachedHEAD.git bisect resetfixes it. -
They give git the arguments the wrong way round
(
git bisect start v0.1.0 main): bad first, then good. The result will be nonsense.git bisect resetand again. -
Bisecting the whole test suite rather than
tests/test_normalise.py: other failures can confuse it. -
No
v0.1.0tag. Their fork has no tags.git tagshows what’s there. They can fetch tags from the original repository, or pair up. -
git merge --ff-onlyrefuses.mainhas moved, or they committed the fix on the wrong branch.git status,git log --oneline --graph, and check they branched frommain. -
git branch -d fix/normalisefails with “not fully merged”. The merge didn’t happen, or they’re on the wrong branch. -
A conflict in the second rebase: it shouldn’t
happen. It means they changed
normalise.pyin their feature branch.
Bridge to episode 11: “Your feature is ready, on
top of a working main. Time to ask your partner to review
it.”
Pull Requests: Authoring and Reviewing
Instructor Note
Timing (about 30 minutes). 12 minutes of talk, then the exercises in time-boxes: open the pull request (4), review (8), respond and approve (6). Use a visible timer. Review takes longest, so don’t let it overrun: three comments only. The Finishing section (squash and merge) is optional in the session: say it’s there for when they have time, or to do later. (Learners who don’t merge won’t be affected: nothing in the later episodes needs this feature merged.)
The base repository trap. Check screens as people open their pull requests. Anything opened against the course repository should be closed and re-opened on the fork.
Pairs. Make sure each learner has been added as a collaborator (episode 1), and the invitation accepted: they need it to be asked for a review. If a partner is missing or behind, pair them with a helper, or have them review the instructor’s example pull request.
Online. Breakout rooms of two. Ask people to share the pull request link in the chat or room.
Common problems:
- The pull request is against the course repository. Close it and open a new one on the fork.
- The reviewer can’t find the pull request. Send the link. Check notification emails.
-
They
git commit --fixupthe wrong commit. The autosquash puts the change in the wrong place.git rebase --abort, or fix it with another interactive rebase. - They squash before the reviewer has looked and then wonder where their comments went. GitHub keeps them, marked “outdated”.
- No partner. Use the prepared example pull request. Have one ready on your own fork, with a few things to comment on.
-
git diff @{u} HEADisn’t empty. Something else changed. Look at it withgit diff @{u} HEAD --stat. -
@{u}means nothing, or errors: the branch has no upstream.git push -u origin <branch>sets it. -
@{u}in some shells needs quoting ('@{u}'). In Git Bash it works as is. - After merging, the branch still shows in the list. There is a Delete branch button on the merged pull request.
What to point out: that every commit and every comment they wrote on day 1 and now is the thing the reviewer is reading. A reviewer who can follow the story approves faster.
Catching Problems Early: Shift Left and CI
Instructor Note
Timing (about 26 minutes). Talk for 10: the table of stages is the key idea, and the stage 2 and 3 sections can be quick. Then the single challenge, which has just one pull request for both exercises. Start the CI pull request early and talk while it runs: the first run takes up to a minute, and there’s waiting time in the exercise. If you’re short on time, do part 1 together, then do part 2 and 3 (break and fix) as a demonstration on your screen. The “going further” step is talking only.
Emphasise the principle: push each check left until it’s too slow or annoying. Ask the room: “what do you already run before pushing?”
Test this before the workshop. I could check the
workflow with actionlint and its commands in a clean
environment, but not run it on GitHub. Do the whole exercise on a real
fork the day before. Also re-check the versions of
actions/checkout and actions/setup-python.
Actions must be enabled on each fork (setup page, step 6). Ask for a show of hands before you start. The Actions tab shows an enable button if not.
Common problems:
-
Nothing happens on the pull request. Actions is
disabled on the fork, or the file isn’t in
.github/workflows/, or the pull request is on the course repository instead of the fork. - The workflow fails with a YAML error. Indentation, or a tab. Open the Actions tab and read the error.
- “Rebase and merge” is greyed out. The branch isn’t up to date, or the repository setting is off. Check Settings then General then Pull Requests.
- The test doesn’t fail in the break-and-fix. They renamed the string in the test as well. Start again.
-
After the autosquash the push is rejected: use
--force-with-lease.
Prepare a fallback before the session. Actions is the part most likely to slow the room down (it runs on GitHub, so you can’t control the timing). Have these ready:
-
A prepared fork with the
add-cipull request already open: a green run, and then the breaking commit with a red run, and a link to each. (Or screenshots of each stage if you can’t rely on the network.) - A decision made in advance about when to stop waiting. A sensible rule: if checks haven’t appeared after two minutes, you screenshare the prepared run and move on.
- Three levels of fallback, from best to simplest: (1) learners run it themselves; (2) learners do the git steps, and you demonstrate the Actions results on your screen; (3) you explain and demonstrate everything, and learners just read the workflow file. Any of them still teaches the idea.
Limits. Public repositories get free Actions minutes. If the fork is private, the allowance is limited. Forks of public repositories are public.
Bridge to episode 13: “We have a fix, merged on
main. But users are still running version 0.2, which has
the bug. How do we get the fix to them?”
Releases: Versions, Tags and Cherry-pick
Instructor Note
Timing (about 35 minutes). 15 minutes for the lifecycle, versions, tags and cherry-pick, and 20 for the exercise. The GitHub release is optional, and a good thing to demo while people finish.
Keep the lifecycle simple. Don’t be drawn into branching-model debates. If someone asks about git flow, say it’s a heavier version of the same idea, for software with scheduled releases, and move on.
Find the fix by its message. Learners deleted their
fix/normalise branch in episode 10, so they look up the
commit on main with git log --grep. (The hash
is the same one the branch had, but they may not have noted it.)
Common problems:
-
git cherry-picksays the commit is empty or already applied. They are onmaininstead ofrelease/0.2. Checkgit branch --show-current. -
git switch -c release/0.2 v0.2.0says the tag doesn’t exist. Their fork has no tags (forked with “Copy the default branch only”).git tagshows what’s there. They can fetch tags from the original repository, or pair up. -
They forget
-x. Harmless here, but explain what it would have told them. -
A conflict on the cherry-pick. It shouldn’t happen.
If it does, they’ve probably edited
normalise.pyon the release branch.git cherry-pick --abortand start again. -
They tag with a lightweight tag (no
-a). It works, butgit tag -nshows no message. Delete it (git tag -d v0.2.1) and re-tag. -
The tag doesn’t appear on GitHub. They pushed the
branch but not the tag.
git push origin v0.2.1. - No “Create a new release” button. On a fork, check Releases is enabled under Settings.
Bridge to episode 14: “That’s the whole workflow. A few things to make it quicker.”
Tooling and Wrap-up
Instructor Note
This episode is a menu. It’s fine to skip most of it, or to tell people it’s there to read afterwards. If you do one thing, do the take-aways and the “one habit” challenge.
The challenge is also a quiet way to end. Ask two or three people to share their chosen habit.
Before you finish: point people to the reference page, remind them their forks and branches are theirs to keep, and share the feedback link.
Optional extras for a longer session or a follow-up:
how git stores files (objects, trees, packfiles),
git bisect with a script on a bigger history,
git rerere in action, worktrees as an exercise, and a look
at a real project’s pull requests.