Advanced Git & Version Control
Q98 / 100

Why can rewriting a single early commit in a long history (e.g. via interactive rebase to edit a commit from months ago) be considered an expensive and disruptive operation?

Correct! Well done.

Incorrect.

The correct answer is A) Because a commit's hash depends on its content plus its parent's hash, changing any commit changes its hash, and since descendants reference their parent by hash, all descendants must be rewritten too, cascading through the rest of history

A

Correct Answer

Because a commit's hash depends on its content plus its parent's hash, changing any commit changes its hash, and since descendants reference their parent by hash, all descendants must be rewritten too, cascading through the rest of history

Explanation

This cascading hash-rewrite is why rebasing/amending shared history is so disruptive to collaborators — every commit after the edited one effectively becomes a "new" commit object, even though its content diff relative to its (also new) parent might be identical to before.

Progress
98/100