Changing a git commit message after I have pushed it to the server?
Posted on In QAHow to change a wrong git commit message after I have pushed it to the server?
If the remote repository is shared with others, it is better to let the wrong git commit message there.
If you use the repository by your own and you are sure that no one else has pulled your latest commit:
First, change the local commit message:
git commit --amend -m "New commit message"
Then, force pushing again:
git push -f
Again, this operation is dangerous. Do it only if you know what you are doing.