Stage 6 — Merge the Branch
Switch back to
main, see the light theme return, then mergedark-themeintomainto adopt the experiment.
What You'll Learn
- How
git checkout mainbrings back the version onmain - How
git merge dark-themepulls commits from another branch onto your current branch - What a fast-forward merge is
Prerequisites
You finished Stage 5. git log --oneline on dark-theme shows four commits. On main, three.
What Changes
- You switch to
main. For a moment, the webpage looks like Stage 3 again (light theme). This is the "aha" moment. - You run
git merge dark-theme. The dark theme is now onmain.
Outcome
mainnow has four commits.- The page on
mainlooks identical to the page ondark-theme. dark-themestill exists. You can delete it later if you want, but merging does not destroy it.