Lesson 5 of 5
Project: the full workflow
The professional workflow chains everything: commit on main, feature branch, isolated commits, then merge into main.
Here you run this cycle by hand: a log for the history, a history dictionary for each branch's position.
history["feature"] = history["main"] # branch at the same point current = "feature" # checkout history["main"] = history["feature"] # merge: main catches up to feature
🎯 Exercise
Run the full workflow. 1) Initial commit on main: history["main"] = 1 and log.append("1: init"). 2) Create feature at the same point (history["feature"] = history["main"]) and switch (current = "feature"). 3) Two commits on feature: set history["feature"] to 2 then 3, with log.append("2: feature A") and log.append("3: feature B"). 4) Merge into main: history["main"] = history["feature"] and log.append("4: merge feature"). 5) Print the number of log entries.
PRO lesson
This advanced chapter is part of CodeAge PRO. Unlock it to keep your adventure going.
Discover PRO →