Git allows you to use an editor of your choice to enter a commit message. If you don't specify one, then the default editor is a system-specific default, usually vi
, which is a modal editor coming from Unix. As the Git FAQ says:
If you haven’t specified an editor specifically for Git, it will by default use the editor you’ve configured using the VISUAL
or EDITOR
environment variables, or if neither is specified, the system default (which is usually vi
). Since some people find vi difficult to use or prefer a different editor, it may be desirable to change the editor used.
(When I wrote this, it was rather tongue-in-cheek, since a great many people do find vi difficult to use because the editing paradigm differs from most other editors. “How to quit vim” is a common search topic.)
My recommendation here is to type Esc
and then :wq
(then Enter
) to quit vi and then configure the editor of your choice instead using the core.editor
option. The Git FAQ provides examples of how to do this properly. Once you've done that, you can attempt your commit or revert again.
If you don't have a preferred editor, nano is a relatively simple editor that I can recommend for this case. I don't believe it's shipped with Git for Windows, though, so you'll need to download it separately.
If you do want to learn to use vi, then I'd recommend the vimtutor program, which comes with Vim (which is the most common vi editor and the option shipped with Git for Windows) that will teach you how to use it properly.