Solution Reference: Challenge 4 -- Branch Out
This shows how to create a branch from each tool. You only needed to use one.
On github.com
- Go to the repository's Code tab
- Click the branch dropdown (it says "main")
- Type a new branch name like
fix/welcome-todo - Click "Create branch: fix/welcome-todo from main"
The branch now exists on GitHub. You can switch to it using the same dropdown.
In VS Code (with Git)
git checkout -b fix/welcome-todo
Or use the Source Control sidebar: click the branch name in the bottom-left status bar, then select "Create new branch."
In GitHub Desktop
- Click the Current Branch dropdown
- Click "New Branch"
- Enter the name
fix/welcome-todo - Confirm it is based on
main
With GitHub CLI
gh repo clone <workshop-org>/learning-room-<your-username>
cd learning-room
git checkout -b fix/welcome-todo
Branch naming
Good branch names are short and descriptive:
fix/welcome-todo-- fixing a TODO in welcome.mdfeature/add-schedule-link-- adding a new linkdocs/update-readme-- documentation change
All of these are valid. The convention type/description is common but not required.
What matters
The learning objective is understanding that branches let you work in isolation without affecting main. If you created any branch with any name, you completed this challenge.
Authoritative Sources
Use these official references when you need the current source of truth for facts in this chapter.
Section-Level Source Map
Use this map to verify facts for each major section in this file.
- On github.com: GitHub Docs, home, GitHub Changelog, About Git, GitHub flow, About pull requests
- In VS Code (with Git): GitHub Docs, home, GitHub Changelog, About Git, GitHub flow, About pull requests
- In GitHub Desktop: GitHub Docs, home, GitHub Changelog, About Git, GitHub flow, About pull requests
- With GitHub CLI: GitHub Docs, home, GitHub Changelog, GitHub Copilot docs, Custom instructions support matrix, About custom agents
- Branch naming: GitHub Docs, home, GitHub Changelog, About Git, GitHub flow, About pull requests
- What matters: GitHub Docs, home, GitHub Changelog