exam questions

Exam 200-901 All Questions

View all questions & answers for the 200-901 exam

Exam 200-901 topic 1 question 597 discussion

Actual exam question from Cisco's 200-901
Question #: 597
Topic #: 1
[All 200-901 Questions]

A developer changed a project and already staged the files in Git ready to be committed. The developer discovers that a colleague has also been working on the same project in Git. Before the commit is finalized, which Git command is used to identify changes after the last commit?

  • A. git diff HEAD
  • B. git diff
  • C. git status
  • D. git diff --cached
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
daniii89
3 months ago
Selected Answer: D
Its D. The developer has already staged the files in Git and wants to identify changes since the last commit before finalizing the commit. git diff --cached Shows staged changes (differences between the staging area and the last commit).
upvoted 1 times
...
Erfan
3 months ago
Selected Answer: D
According to below information , I think that answer would be: D git diff --cached: Only shows staged changes. git diff HEAD: Shows all changes (both staged and unstaged). If you want to review what you've already staged for the next commit, git diff --cached is your go-to. If you want to review everything that has changed (staged and unstaged), git diff HEAD is the one to use
upvoted 2 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