200-901 Software Development and Design Practice Question
Which Git command is used to switch to an existing branch named 'feature-x' and update the working directory?
⚠ Common exam trap
Cisco often tests the distinction between `git checkout` for switching to an existing branch versus `git checkout -b` (or `git switch -c`) for creating and switching to a new branch, and candidates frequently confuse the `-c` flag as a switch-only option rather than a creation flag.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
git checkout feature-x
`git checkout feature-x` is the traditional Git command that switches the HEAD reference to the existing branch 'feature-x' and updates the working directory to match that branch's commit history. This command performs both the branch switch and the working tree update in one operation, which is the core requirement of the question.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
git merge feature-x
Why it's wrong here
Merges the branch into the current branch, does not switch.
- ✗
git branch feature-x
Why it's wrong here
This creates a new branch but does not switch to it.
- ✗
git switch -c feature-x
Why it's wrong here
The -c flag creates a new branch; for existing branch use 'git switch' without -c.
- ✓
git checkout feature-x
Why this is correct
Switches to the specified branch and updates the working directory.
Go deeper
Related to this question
About these practice questions
Courseiva writes every 200-901 question from scratch — 989 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This 200-901 practice question is part of Courseiva's free Cisco certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 200-901 exam.