XK0-005 Exam QuestionsBrowse all questions from this exam

XK0-005 Exam - Question 21


An administrator needs to make some changes in the IaC declaration templates. Which of the following commands would maintain version control?

Show Answer
Correct Answer: D

To maintain version control when making changes to IaC declaration templates, one should first clone the repository, and then create a new branch to make the changes without affecting the main branch. The command 'git clone' is used to clone the repository to the local machine, and 'git checkout -b <new-branch>' is used to create and switch to a new branch. This procedure helps keep the main branch clean and allows tracking changes separately, which is essential for good version control practices.

Discussion

5 comments
Sign in to comment
linux_adminOption: D
Feb 12, 2023

D. git clone https://github.com/comptia/linux+.git git checkout -b <new-branch> The git clone command is used to clone a remote Git repository, which in this case is the repository located at https://github.com/comptia/linux+.git. This command will download the entire repository to the local machine. After cloning the repository, the administrator should create a new branch using the git checkout -b <new-branch> command. This will create a new branch in the Git repository and make it the current branch. The administrator can then make changes to the IaC declaration templates in this branch without affecting the main branch.

linux_admin
Feb 12, 2023

Once the changes are made, the administrator can then commit them to the new branch using git commit. Finally, the administrator can merge the changes back into the main branch using git merge. This will allow the changes to be tracked and maintain version control of the IaC declaration templates. The other options are not correct or do not achieve the desired effect. The git push origin command is used to push changes to a remote repository, but it should not be used before making changes. The git fetch New-Branch command is used to retrieve changes from a remote repository, but it does not create a new branch. The git status command is used to check the current status of the Git repository, but it does not create a new branch or allow changes to be made.

TheRealManishOption: D
Nov 19, 2022

Can anyone confirm the answer is D? I've been researching this for 3 hours and have learned the basics of GIT and have no clue if D is correct.

Nvoid
Nov 26, 2022

I know its not A or C, so it has to be B or D, and "-b <new_branch>" seems right from the last time i used git in ages now.

MrGykzOption: D
Nov 21, 2022

You could omit <branch>, in which case the command degenerates to "check out the current branch", which is a glorified no-op with rather expensive side-effects to show only the tracking information, if exists, for the current branch. git checkout -b|-B <new-branch> [<start-point>] Specifying -b causes a new branch to be created as if git-branch[1] were called and then checked out. In this case you can use the --track or --no-track options, which will be passed to git branch. As a convenience, --track without -b implies branch creation; see the description of --track below. documentation: https://git-scm.com/docs/git-checkout

PinnubhaiOption: D
Jan 7, 2023

git checkout -b|-B <new_branch> [<start point>] Specifying -b causes a new branch to be created as if git-branch(1) were called and then checked out.

AlizadehOption: D
Aug 16, 2023

D. git clone https://github.com/comptia/linuxt+-.git git checkout -b <new-branch>.