Developing Applications and Automating Workflows Using Cisco Platforms (DEVASC) — Question 379

A file in a local Git repository has been updated and issued the git add . command. The git diff command has been run to compare the changes to the previous commit, but nothing shows. Which action identifies the problem?

Answer options

Correct answer: D

Explanation

The correct answer is D because the git diff --staged command shows the differences between the staged changes and the last commit. Option A is incorrect as running git add . again does not address the comparison needed. Option B is also wrong because committing does not help identify what was staged. Option C, while useful, does not provide the specific comparison between the staged changes and the last commit.