How do I change an existing Git commit message?

In order to change an existing Git commit message, the easiest way to do it is to simply run the following command (where New commit message is your new message):

git commit --amend -m "New commit message"

If you would like to be able to adjust a multi-line commit message, use the following command:

git commit --amend

After running this command, an editor will open up and allow you to edit the multiple lines used in the commit message. Make sure to save your changes and you’re good to go!

Leave a Reply

Your email address will not be published. Required fields are marked *