Skip to content
GitTree

Video: Correct a local commit message or content

The video plays in YouTube’s player, in privacy-enhanced mode.

Correct a typo and message in one private hero commit while retaining its old tip. Learn why amend replaces identity and why unrelated staged content must stay out.

Read the full lesson

The article has every step and command from the video, the practice exercise and the questions.

Go to the lesson

Video transcript

The narration of the video, cue by cue.

  1. Start from the exact checkpoint.
  2. Name the branch, index and working version.
  3. Prepare only the isolated course copy.
  4. Protect the private draft before replacing it.
  5. Save the complete intended correction.
  6. Review the index, not only the message.
  7. Amend replaces the actual last commit.
  8. Write the corrected subject explicitly.
  9. Submit the replacement only once.
  10. Same parent does not mean same identity.
  11. Message-only editing has a separate scope.
  12. What does amend create?
  13. Git objects are immutable; replacement gets a new ID.
  14. What must be reviewed?
  15. Composer amend uses the index and last commit context.
  16. Parent of corrected C′?
  17. The replacement occupies the same ancestry position.
  18. Add an unrelated staged file before amend: content?
  19. The current index defines the replacement tree.
  20. Draft was published: proceed as private?
  21. Published identity may be used by others.
  22. Which evidence is required?
  23. Verify both replacement identity and intended content.
  24. Verify the actual result, not just a message.
  25. Predict the changed input before acting.
  26. Preserve useful work before recovery.
  27. Prove the checkpoint before continuing.
  28. Keep the verified result for the next step.

All tutorials