From Branch to Main and Back¶
Run the From Branch to Main and Back MicroSim Fullscreen
About This MicroSim¶
This flow shows the eight steps from starting work on a branch to merging it into main, and what to do if a merged change turns out wrong. Two loops show where you repeat: after each small step, and when a review asks for changes.
Each step guards against a different problem. Committing gives you a save point. A branch keeps experiments away from the live app. Pushing puts a copy on GitHub. Reviewing the diff catches scope creep. A revert undoes one bad change without losing later work. The quiz checks that you can link each problem to the step that protects you from it.
The flow runs top to bottom so that every step stays readable at textbook width.
How to Use¶
- Click any step to read what happens there. The note appears beside the step.
- When you're ready, press Test yourself. A problem appears at the top.
- Click the step that guards against that problem. The correct step turns green, and a wrong pick turns red.
- Press Next question for the next problem. After question 5, a summary shows which answers were right.
- Press Start over to explore again or retake the questions.
You can also reach each step with the Tab key and open it with Enter.
Iframe Embed Code¶
You can add this MicroSim to any web page by adding this to your HTML:
<iframe src="https://arunbatchu.github.io/good-enough-engineering/sims/branch-to-main-workflow/main.html"
height="604px"
width="100%"
scrolling="no"></iframe>
Lesson Plan¶
Learning Objective¶
The learner will explain which step in the branch, pull request and merge workflow protects against each of five problems, by choosing the right step for each problem with at least four of five correct.
Grade Level¶
Adult professional (Good Enough Engineering)
Duration¶
10 minutes
Prerequisites¶
- Commits, save points and branches
- Feature branches and the main branch
- Diffs and reviewing a diff
- Push, pull requests, code review and merge
Activities¶
- Exploration (4 min): Click all eight steps and read each note. Trace the two loops back to step 3.
- Guided Practice (4 min): Answer the five questions. For each miss, click the correct step and read its note again.
- Assessment (2 min): Without the sim, say which step you'd lean on if an agent's change quietly touched the sign-in code.
Assessment¶
- At least 4 of 5 questions correct on the first attempt.
- The learner can explain why committing and pushing are separate steps that guard against different problems.
Common Misconceptions¶
- Branches are only for teams.
- A pull request is only useful when someone else reviews it.
- Once a change is merged it can't be undone.
- Committing and pushing are the same step.
References¶
- Chapter 5: Version Control - the sections "Pull Requests and Code Review" and "Revert and Rollback."
- GitHub Docs: About pull requests - what a pull request shows and how it is reviewed.
- Mermaid flowchart syntax - the library that draws the flow.