Git · Senior · Question 76 of 76
What happens to commit hashes when you rebase onto the same base without changes?
- 1They always change, even if nothing moved at all
- 2They never change, even with
--force-rebase - ✓Correct answer: They change with
--force-rebase, else Git keeps them
Explanation
If the branch is already on top of the base, rebase is a no-op. Forcing it re-applies commits with new committer dates, hence new hashes.