200-901 Software Development and Design Practice Question
A developer is using Git for version control. After creating a new feature branch 'feature-login' from 'main', they make several commits. Meanwhile, another developer has merged changes into 'main'. The developer wants to incorporate the latest main changes into 'feature-login' without creating a merge commit. Which Git command should they use?
⚠ Common exam trap
Cisco often tests the distinction between `git merge` and `git rebase` in the context of avoiding merge commits, and the trap here is that candidates may choose `git rebase main` (Option A) without realizing it does not fetch remote changes, or they may choose `git merge main` (Option B) thinking it can be done without a merge commit, which is incorrect.
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 pull --rebase origin main
`git pull --rebase origin main` fetches the latest changes from the remote `main` branch and then rebases the current `feature-login` branch onto those changes. This incorporates the new commits from `main` without creating a merge commit, resulting in a linear history. The `--rebase` flag ensures that the developer's commits are replayed on top of the updated `main`, avoiding the extra merge commit that `git merge` would create.
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 rebase main
Why it's wrong here
Missing fetch; need to fetch latest main first. But the command itself is correct if main is up-to-date, but typically you'd fetch first.
- ✗
git merge main
Why it's wrong here
Merge creates a merge commit, which is not desired here.
- ✓
git pull --rebase origin main
Why this is correct
This fetches and rebases the current branch onto main, incorporating changes without a merge commit.
- ✗
git checkout main && git pull && git checkout feature-login && git merge main
Why it's wrong here
This creates a merge commit.
Go deeper
Related to this question
About these practice questions
This 200-901 question is part of Courseiva's 989-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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.