How do you correct a commit message in Git?

Learn how to fix a mistake using the “git commit -amend” command and understand when it is appropriate to force push a changed commit.

By Lorna Jane Mitchell
October 25, 2016
Screenshot from "How do you correct a commit message in Git?" Screenshot from "How do you correct a commit message in Git?"

So you made a mistake in a previous commit message and want to fix it. In this video Lorna Mitchell teaches you how to fix a mistake using the “git commit -amend” command and explains when it is appropriate to force push a changed commit. Git beginners will also learn how to go back and reword or remove old commits from git history.

Grow your Git skills in Safari now with our Git Learning Path.

Learn faster. Dig deeper. See farther.

Join the O'Reilly online learning platform. Get a free trial today and find answers on the fly, or master something new and useful.

Learn more

Lorna Mitchell is based in Leeds, UK where she is a Developer Advocate at IBM Cloud Data Services and an experienced developer and trainer. Lorna is the accomplished author of a number of books including PHP Web Services, the Git Workbook, and PHP Master. She brings her technical expertise to audiences all over the world, dispensing guidance on a wide range of technical topics, all with a very practical slant. When she’s not busy spreading knowledge Lorna blogs at lornajane.net.

Post topics: Software Engineering
Post tags: Questions
Share: