3.3 Given a scenario, perform basic version control using Git.
Objective 3.3 sits in Scripting, Containers, and Automation, which carries 19% of the Linux+ exam. The questions below are original, written from the official objective title above, and each explanation cites the CompTIA page it rests on.
Objective title verbatim from the official objectives. CompTIA exam page ↗
A worked example
Shown solved, with the whole explanation open: this is what every question here carries.
An administrator wants to discard all uncommitted working-tree changes and match the last commit exactly. Which command does that?
Correct.
Concept
Reset moves the branch pointer, and its mode decides whether the index and working tree are also rewritten to match the target commit.
Why D
git reset --hard HEAD updates the index and overwrites working-tree files to match HEAD, discarding all uncommitted changes.
Now you: objective 3.3 questions
No account needed. The explanation opens when you answer.
Sample question 1 of 3
An administrator must undo the last commit but keep its changes staged, ready for a new commit. Which reset mode fits?
Sample question 2 of 3
After a bad commit was already pushed and pulled by teammates, an administrator must undo it without rewriting shared history. Which command is correct?
Sample question 3 of 3
During a merge an administrator sees conflict markers <<<<<<< in a file. After editing it to resolve the conflict, what completes the merge?
Full Linux+ question bank coming
We’re writing the complete bank from the official objectives right now. Leave your email and we’ll tell you when it ships, nothing else, ever.
Read the sources
These are the official pages the questions above cite. Reading them is studying the objective from the primary source, which is what the explanations point you toward anyway.