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)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more