Courseiva
hardMultiple ChoiceObjective-mapped

XK0-006 Practice Question: Refer to the exhibit

Network Topology
$ git logonelinegraphRefer to the exhibit.```* 3a1b2c3 Merge branch 'feature/update'|/* 1m2n3o4 Initial commit

Refer to the exhibit. The development team is using Git to manage their project. A release candidate needs to include only the changes from the `feature/update` branch, but NOT the 'Add new module' commit. Which Git command sequence should be used to create a new release branch that contains only the feature branch?

⚠ Common exam trap

Test-takers frequently think `git revert` removes a commit from history, when in fact it only creates a new inverse commit, leaving the original commit present in the branch's history.

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 -b release 1m2n3o4 && git cherry-pick 4d5e6f7 8f9g0h1

It creates a new release branch starting from the commit before the 'Add new module' commit (1m2n3o4), then cherry-picks only the two commits from the `feature/update` branch (4d5e6f7 and 8f9g0h1) that represent the desired changes. This ensures the release branch contains exactly the feature branch changes without including the unwanted 'Add new module' commit.

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 checkout feature/update && git rebase 1m2n3o4

    Why it's wrong here

    Rebasing the feature branch onto the initial commit would reorder history but still include only the feature commits, but the question asks for a release branch creation.

  • git checkout -b release 1m2n3o4 && git cherry-pick 4d5e6f7 8f9g0h1

    Why this is correct

    Starting from the initial commit, cherry-picking the two feature branch commits includes only those changes, excluding 'Add new module'.

  • git checkout -b release master && git revert 2j3k4l5

    Why it's wrong here

    Reverting removes the commit's changes but leaves the commit history; the release branch would still have the merge of both branches.

  • git checkout -b release feature/update && git merge --no-ff master

    Why it's wrong here

    This would merge master into the feature branch, including the 'Add new module' commit.

About these practice questions

This XK0-006 question is part of Courseiva's 979-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 →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This XK0-006 practice question is part of Courseiva's free CompTIA 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 XK0-006 exam.