21

I am just learning git and the terminal and I wanted to make a test commit but I cannot seem to be able to escape the text editor window to save the commitenter image description here

31

It looks like you're inside the vi editor. Typing :wq and pressing enter should do it, i.e. save the commit message and exit.

: enters the command mode, w is for "write" (save) and q is for "quit".

You may need to hit escape before :wq to exit the insert mode (vi is a mode based editor).

If you want to exit without saving hit escape, :q! and enter.

git opens your default editor so you can edit the commit message. You can change the default editor, even to graphical text editors (such as Sublime Text). See here for example.

| improve this answer | |
6
  1. Press Escape
  2. Press shift+Z shift+Z (capital Z twice).

It works a bit faster.

| improve this answer | |

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .