nerdexam
CompTIACompTIA

XK0-005 · Question #346

XK0-005 Question #346: Real Exam Question with Answer & Explanation

The correct answer is A: Init. This question asks for the Git command used to create a separate line of development for testing changes without affecting the main branch.

System Management

Question

An administrator clones a Git repository onto a local laptop. While inspecting the code, the administrator notices a bug and wants to fix it. Which of the following is the BEST command for the administrator to use to test a patch for the prior to updating the version saved in master?

Options

  • AInit
  • BBranch
  • CStash
  • DComit
  • Emerge

Explanation

This question asks for the Git command used to create a separate line of development for testing changes without affecting the main branch.

Common mistakes.

  • A. git init initializes a new Git repository, which is not applicable here as the repository is already cloned.
  • C. git stash temporarily saves changes that are not ready to be committed, allowing the user to switch branches or perform other operations, but it doesn't create a new line of development.
  • D. git commit records changes to the repository's history on the current branch, which would directly affect the master branch if the bug fix were committed there.
  • E. git merge combines changes from one branch into another, which is typically done after a bug fix has been developed and tested on a separate branch, not as the initial step to test a patch.

Concept tested. Git branching for isolated development

Reference. https://git-scm.com/docs/git-branch

Topics

#Git#Version Control#Repository Initialization#Code Management

Community Discussion

No community discussion yet for this question.

Full XK0-005 PracticeBrowse All XK0-005 Questions