exam questions

Exam XK0-005 All Questions

View all questions & answers for the XK0-005 exam

Exam XK0-005 topic 1 question 21 discussion

Actual exam question from CompTIA's XK0-005
Question #: 21
Topic #: 1
[All XK0-005 Questions]

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

  • A. git clone https://github.com/comptia/linux+-.git
    git push origin
  • B. git clone https://qithub.com/comptia/linux+-.git
    git fetch New-Branch
  • C. git clone https://github.com/comptia/linux+-.git
    git status
  • D. git clone https://github.com/comptia/linuxt+-.git
    git checkout -b <new-branch>
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
linux_admin
Highly Voted 1 year, 2 months ago
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.
upvoted 8 times
linux_admin
1 year, 2 months ago
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.
upvoted 7 times
...
...
Alizadeh
Most Recent 8 months, 2 weeks ago
Selected Answer: D
D. git clone https://github.com/comptia/linuxt+-.git git checkout -b <new-branch>.
upvoted 1 times
...
Pinnubhai
1 year, 3 months ago
Selected Answer: D
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.
upvoted 1 times
...
MrGykz
1 year, 5 months ago
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
upvoted 1 times
...
TheRealManish
1 year, 5 months ago
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.
upvoted 1 times
Nvoid
1 year, 5 months ago
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.
upvoted 1 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago