Spot the Branch Mistake
Find the Mistake Easy
Question
This command tries to switch to an existing branch 'develop'. What is wrong?
Code
git checkout -b develop
Hint
-b means create, not just switch.
Explanation
git checkout -b develop creates a new branch called 'develop'. If 'develop' already exists, Git reports an error. To switch to an existing branch, use git checkout develop (without -b). Use -b only when you want to create a new branch.
Related Resources
Related Lessons
Related Cheatsheets
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.