I wish this was asked sooner. It would have saved so much confusion!
If the editor is vim, then:
However, I recommend configuring git to use nano instead.
git config --global core.editor nano
Then use CONTROL+X to exit (although you may be prompted to save if you made changes).