If after quickly typing in a commit you notice a typo, as such:
git commit -m "this is splet wrong"
You can quickly fix this using Git’s
--amend flag, as such:
git commit --amend
- By default, the vi editor is opened. press
ato enter INSERT mode and make changes
ESCto leave INSERT mode and save by typing
:wq(write and quit), if you accidently made everything 10x worse, you can cancel by typing
:q!(quit, ignoring changes)
- Your commit now has an updated commit message and you can push as normal
No more embarrassing errors highlighting non-compliance with the absurd and illogical English (or other) written language.