How do I edit an incorrect message in a git push?


I wrote something I did not want in the commit comment.

git commit -m "comentario indeseado"

git push

How can I change or update the message?

Eye, I've already pushed and I want to remove the message in the repository as well.

Is it possible?

asked by Gemasoft 26.01.2016 в 18:00

1 answer


== > Replace the message of the last commit like this:

git commit --amend -m "nuevo mensaje"

git push --force

Doing this is considered a bad practice and has its risks, as mentioned in this link:

Why should not you rewrite published commits?

answered by 26.01.2016 / 18:07