In case you need to change the description of a commit , to make the description clearer, or specify which issue it is linked to.
I would like to know how do I edit the message that accompanies the commit , after it has been executed.
It's Quiet Guilherme, do the following
git commit -m "Nova mensagem que vai substituir a anterior" --amend
This will overwrite your old
And even if the commit is not the last one, you can edit an old commit using the interactive commit mode
git rebase -i
It is also useful if you have made any changes and want them to be part of the previous
for example: You made a
commit to close issue X, but saw that something was missing, performed this operation, but you don't want to have two commits closing the same issue, so you merge the two into a single
Oh and this only works fine if you haven't