Often, when I finish writing a commit message in VIM, I type :Wq<ENTER>instead :Wq<ENTER>because I hold down the shift key to type a colon. This makes VIM respond E492: Not an editor command: Wq.
So far so good, I'm just retyping :Wq<ENTER>to save the commit message and exit VIM. However, the commit does not work, and the terminal shows something like this:
$ git commit
$ error: There was a problem with the editor 'vi'.
$ Please supply the message using either -m or -F option.
Why would accidentally input :Wq<ENTER>before doing the correct :Wq<ENTER>result in commit failure? Is there a way to get a commit after input :Wq<ENTER>?
source
share