Which Git Command Creates an Infrastructure as Code Snapshot?
A DevOps engineer wants to work on a snapshot of the infrastructure as code configuration. Which of the following commands should the engineer use to accomplish this task?
Community Votes
75% of anonymous learners picked answer D. Votes are pick records left by other test-takers — they are not the verified answer.
Community Insight
The exam tests whether candidates can distinguish between Git branches (working copies) and tags (point-in-time snapshots); the trap is confusing git branch with git tag.
The XK0-005 question tests knowledge of Git commands for creating snapshots of infrastructure as code. Community consensus heavily favors git tag as the correct answer, associating tags with immutable snapshots.
Many candidates choose git branch (C) because creating a branch feels like making a working copy, but the keyword 'snapshot' specifically points to git tag as the intended answer.
Community Discussion (4 comments)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
Expert Analysis
Why the Answer Is Correct
The suggested answer is git tag (D). In Git terminology, a tag is a named reference to a specific commit, effectively acting as a read-only snapshot of the repository at a point in time. Community comment [3] explicitly states, 'Tagging is synonymous with the snapshot feature,' reinforcing this interpretation. Comment [1] also confirms that git tag is used to create a snapshot of the codebase. For DevOps engineers working with infrastructure as code, tagging a release or configuration state is the standard way to preserve an immutable baseline.Why the Other Options Are Wrong
git pull (A) fetches and merges remote changes — it modifies the working tree rather than preserving a snapshot. git push (B) uploads local commits to a remote repository and does not create any local snapshot marker. git branch (C) creates a new line of development, but branches are mutable and intended for ongoing work, not static snapshots. Comment [2] argues for branches, but the question's wording — 'snapshot' — specifically targets tags, which are designed to be immutable markers.Community Comment Notes
The vote split is 75 for D and 25 for C, indicating strong but not unanimous agreement. Comment [2] is the primary dissent, arguing that a developer would 'want to create a branch to work on.' However, comments [1], [3], and [4] all support D, with [3] directly linking 'tag' to 'snapshot.' The consensus aligns with the suggested answer, though the ambiguity in the question wording ('work on a snapshot') may have misled some candidates toward git branch.Official Reference
Exam Strategy
When CompTIA uses the word 'snapshot' in a Git context, think 'tag' — tags are immutable point-in-time markers. If the question says 'work on a copy' or 'isolate changes,' then think 'branch.'