orokusaki orokusaki - 1 year ago 143
Git Question

VIM for Windows - What do I type to save and exit from a file?

Using WinXP I accidentally typed

git commit -a
instead of
git commit -am "My commit message"
, and now I'm viewing my CMD prompt filled with the file version of my commit message ("Please enter the commit message for your..."). I've added my message to the top, but now I can't figure out how to save and leave. I tried to press CTRL + W + Q, but it doesn't do anything but add
where the cursor is.

I also tried esc first, and then CTRL + W + Q, but it says
No write since last change (add ! to override)

Answer Source

Press ESC to make sure you are out of the edition mode and then type:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download