DEV Community

Sumanth
Sumanth

Posted on

How to change commit message in Git ?

Sometimes we need to change the git commit message which can be either pushed/not-pushed commit, here is how we can change the git commit message.

To change commits which are not pushed

git commit --amend
Enter fullscreen mode Exit fullscreen mode

commits which are already pushed

git commit --amend
git push origin master --force
Enter fullscreen mode Exit fullscreen mode

By using --force we can update our commit message on remote repo also

Top comments (0)