Branches & merging
Exercise30 min
Branches & merging
A branch is a parallel universe for one idea:
git switch -c feat/lesson-viewer
# …work, commit…
git switch main
git merge --no-ff feat/lesson-viewerThe workflow that keeps merges boring: branch → commit often → rebase onto main when it moved → merge back. Conflicts are not failures; they are git asking you what "both sides meant" — small branches make the question small.
--no-ff keeps the merge commit, so history shows that a feature landed, not just what it contained.
Exercise
Create a branch, make two commits, merge back with --no-ff. Then inspect git log --graph and describe what the merge commit records.
Practice in the diagram lab
This lesson's practice belongs in the diagram editor — design the schema you just read about, grade it against the solution, and save it to your account.
Open the diagram lab