Git - How to close commit editor?

aniskhan001 picture aniskhan001 · Nov 5, 2012 · Viewed 309.1k times · Source

I'm new to git and learning from a PDF. I just executed a command $ git commit and it opens a new editor. But I'm trying to close that new commit editor. How to do this? I'm using git on windows.

Answer

tpg2114 picture tpg2114 · Nov 5, 2012

Save the file in the editor. If it's Emacs: CTRLX CTRLS to save then CTRLX CTRLC to quit or if it's vi: :wq

Press esc first to get out from editing. (in windows/vi)