CS FundamentalsHardProduct-company placement · Git interview

A file was renamed from util.js to helpers.js three months ago. git log helpers.js shows only the commits since the rename. Which command shows the full history across the rename?

  1. A. git log --all helpers.js
  2. B. git blame helpers.js
  3. C. git log --follow helpers.js
  4. D. git reflog helpers.js

Correct answer: C. git log --follow helpers.js

Git does not store renames; it detects them by content similarity. --follow makes git log track a single file across such renames. --all adds branches but still stops at the rename.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic