1
I did the following:
Git add . //Adicionei todos os arquivos alterados
Git commit -m 'mensagem que quero editar'
Now, before I push, I want to edit the message from this commit. How do I?
UPDATE
I used the git commit --Amend command, the text editor was opened, applied the changes. To finish the editor and apply the changes, you need to use the :x command
:x
is a Vim command, which is an editor that is already installed on linux/Unix and also on Windows git-bash (and many other shells also come with some built-in version). Anyway, it’s an editor that has nothing to do with git, other than the fact that on many systems it’s already set up to be the default editor - although this can be changed in the settings– hkotsubo
Thanks for the explanation.
– Lucas
Just a detail, I do not recommend using
--amend
after you have already pushed, because when you push you need to give a -f (force), the problem with that is that you lose one of the Tages that may be being worked by another dev, the ideal is to create a new commit and add some identifier that was a replica of change, is much better and safer...– Ivan Ferrer