DEV Community

loading...

How to change commit message in Git ?

movingmelody profile image Sumanth ・1 min read

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

Discussion (0)

pic
Editor guide