DEV Community

Elhabib Soufain
Elhabib Soufain

Posted on

2

How to change commit message

Changing the Most Recent Commit

The git commit --amend command allows you to change the most recent commit message.
Not pushed commit
To change the message of the most recent commit that has not been pushed to the remote repository, commit it again using the --amend flag.

1: Navigate to the repository directory in your terminal.

2: Run the following command to amend (change) the message of the latest commit:

git commit --amend -m "New commit message."
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started