An administrator needs to version control changes to IaC declaration templates.
Which command will maintain version control?
The Correct Answer is: D. git clone https://github.com/comptia/linux+-.git && git checkout -b <new-branch>
This command sequence is best practice for version-controlling Infrastructure as Code (IaC) templates. It first clones the repository locally, then creates and checks out a new branch where the administrator can safely make and track changes. This ensures version history, collaboration, and rollback capabilities are maintained.
Why the other options are incorrect:
A. git clone https://github.com/comptia/linux+-.git git push origin
This is a malformed command. It incorrectly combines cloning a repository with pushing to the origin. git push must be used after changes are committed to a local branch—not directly after cloning.
B. git clone https://github.com/comptia/linux+-.git git fetch New-Branch
This command is also syntactically incorrect. git fetch cannot be used this way directly in a single command line with clone, and it doesn’t switch to or create a branch—just retrieves data.
C. git clone https://github.com/comptia/linux+-.git git status
git status checks the status of a working directory but does not perform any version control action. It provides no branching or change-tracking functionality and doesn’t help set up version control after cloning.
Discover a range of courses designed to provide you with the knowledge and skills needed to excel in your chosen field.
You don’t need one month to study and pass your test.
With Prepsaret, it takes you a few days to grasp all the concepts needed to pass your exams