CS FundamentalsVery hardProduct-company placement · Git

Priya rebases Rahul's three commits onto the latest main. What happens to the author and committer fields of the rewritten commits?

  1. A. Both fields become Priya, with today's date on each
  2. B. Both stay as Rahul's original values, since content is unchanged
  3. C. Author becomes Priya, while committer stays as Rahul
  4. D. Author stays Rahul (original date); committer becomes Priya, now

Correct answer: D. Author stays Rahul (original date); committer becomes Priya, now

Git tracks who wrote a change (author) separately from who applied it (committer). Rebasing creates new commits, keeping author details by default but setting the committer to whoever ran the rebase at that time, which also contributes to the new hashes.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic