Steps — Stage 4: Try a Branch
Prerequisites
Completed Stage 3. git log --oneline shows three commits. git branch shows only main.
Steps
1. List your branches
bash
git branchYou see one line: * main. The asterisk means "this is your current branch."
2. Create and switch to a new branch
bash
git checkout -b dark-themeThis does two things in one command:
- Creates a new branch called
dark-theme. - Switches to it.
You will see a message like Switched to a new branch 'dark-theme'.
3. List branches again
bash
git branchNow you see two lines:
main
* dark-themeThe asterisk has moved. You are on dark-theme.
4. Confirm nothing changed
Open index.html in the browser. It looks exactly the same as Stage 3. Run git status — clean. Run git log --oneline — still three commits.
This is important: a new branch by itself changes nothing visible. It just puts a new label on the current commit.
Verify
git branchlistsmainand* dark-theme.git statussays clean.git log --onelineshows three commits — the same three.- The browser shows the same styled page with the scoreboard.