Intermediate
Git & Version Control
Q62 / 100
What does "git commit --amend" do?
Correct! Well done.
Incorrect.
The correct answer is B) It modifies the most recent commit, allowing you to change its message and/or add additional staged changes to it, effectively replacing it with a new commit
B
Correct Answer
It modifies the most recent commit, allowing you to change its message and/or add additional staged changes to it, effectively replacing it with a new commit
Explanation
"git commit --amend" is useful for fixing a typo in the last commit message or adding a forgotten file, but it creates a new commit hash, so amending commits already pushed to a shared branch can cause issues for collaborators.
Progress
62/100