← Quiz: How Git Works Inside: all 10 questions
Quiz: How Git Works Inside · Question 8 of 10
Why does git commit --amend always produce a new commit id?
Why does git commit --amend always produce a new commit id?
- A.Git adds a random number to amended commits
- B.Amend deletes the repository history
- C.Commit ids are assigned by GitHub
- D.The commit's content (message, tree or time) changes, so its hash changes
Answer & explanation
Correct answer: The commit's content (message, tree or time) changes, so its hash changes
An id is the hash of the content, so any change produces a different id.
Can you get the rest right without peeking?
Take the timed Quiz: How Git Works Inside quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →