What is the purpose of git blame?

What is the purpose of git blame?

a) To show who made changes to each line of a file
b) To delete a commit
c) To reset the repository
d) To merge branches

Answer:

a) To show who made changes to each line of a file

Explanation:

The git blame command shows who made changes to each line of a file, along with the commit hash and timestamp for each change. This is useful for identifying when and by whom specific changes were introduced.

For example, running git blame filename will display each line of the file, along with the author and commit details responsible for that line.

git blame is helpful for tracking down the source of bugs or understanding the history of changes to a particular file.

Reference:

Top 100 Git and GitHub MCQ Questions and Answers

Scroll to Top