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

A developer is working on a new feature and finds an old piece of code that must be discussed. The developer wants to find the original coders for the code to discuss the issue. Which Git command annotates the listing of the source file with the author that created or last edited a line?

Answer options

Correct answer: C

Explanation

The correct answer is C, as 'git blame' shows each line in a file along with the corresponding author information. Option A, 'cat filename | git diff', is used for comparing file changes, not for identifying authors. Option B, 'git log', provides a history of commits but does not show line-by-line authorship. Option D, 'git reflog', tracks changes to the reference logs and is unrelated to line authorship.