A git commit
always requires a comment. You can give one like this
git commit -m "my comment"
. If you do not provide a comment here, then a text editor pops up to force you to give a comment.
Sometimes, you may actually need the editor to put in the commit message. This generally is required when you want to give a more detailed description of the commit along with the summary (write the summary followed by a blank line followed by the description).
This is an extract from git help commit.
Though not required, it's a good idea to begin the commit message with a single short (less than 50 character) line summarizing the change, followed by a blank line and then a more thorough description. Tools that turn commits into email, for example, use the first line on the Subject: line and the rest of the commit in the body.
EDIT:
And after you type text in your text editor, just save and close it. If you try to do it without providing any comment, the commit will fail.