Using Windows XP I accidentally typed git commit -a
instead of git commit -am \"My commit message\"
, and now I\'m viewing my CMD prompt filled
Press ESC to make sure you are out of the edit mode and then type:
:wq
Instead of telling you how you could execute a certain command (Esc:wq), I can provide you two links that may help you with VIM:
However, the best way to learn Vim is not only using it for Git commits, but as a regular editor for your everyday work.
If you're not going to switch to Vim, it's nonsense to keep its commands in mind. In that case, go and set up your favourite editor to use with Git.
Use:
:wq!
The exclamation mark is used for overriding read-only mode.
Esc to make sure you exit insert mode, then :wq
(colon w q) or ZZ
(shift-Z shift-Z).
A faster way to
would be
:x
If you have opened multiple files you may need to do a
:xa
:q!
will force an unconditional no-save exit