3

I'm on Windows. After git commit, I entered a message. Then I tried Ctrl+O to save but it doesn't work (I guess I'm on nano, am I mistaken?). enter image description here

user310291
  • 36,946
  • 82
  • 271
  • 487
  • Re "I guess I'm on nano": please tell _us_ what editor `git` is using on your system; what does `git config core.editor` return? – mklement0 Mar 08 '20 at 23:35
  • It looks like `vim`. Try `Esc`, and then input `:wq`, and `Enter`. To set an editor as the default, see https://stackoverflow.com/questions/2596805/how-do-i-make-git-use-the-editor-of-my-choice-for-commits. – ElpieKay Mar 09 '20 at 01:14
  • @ElpieKay, see also: https://www.freecodecamp.org/news/one-out-of-every-20-000-stack-overflow-visitors-is-just-trying-to-exit-vim-5a6b6175e7b6/ – mklement0 Mar 09 '20 at 01:45

2 Answers2

3

Nano was added as a choice in 2017 with Git For Windows, because of issue 1224: "Add nano as a choice of editor(s) for git-commit because vim increases what we have to tell to beginners" (!)

But the editor by default remains "vim".

In your case, since you have modified the comment, ESC followed by :x is enough.

mklement0
  • 382,024
  • 64
  • 607
  • 775
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
2

If this is nano, commands are Ctrl + X , then Enter (maybe multiple times depending on your conf)

Nicolas Voron
  • 2,916
  • 1
  • 21
  • 35