3

I am trying to add a file to my github account using git bash. I have "commit", and I have entered the message required. But now, I am stuck (MINGW64). If I try :q, :quit, :quit!, nothing happens. If I try CTRL+C, I can enter :quit! but in this case my commit is aborted.

Do you have any idea?

Cyrus
  • 77,979
  • 13
  • 71
  • 125
Oolis
  • 146
  • 1
  • 2
  • 12
  • 1
    Ok, I have finally found a solution, and I post it (maybe it could help a newbie like me): esc then :wq. [link]http://stackoverflow.com/questions/5599122/problems-with-entering-git-commit-message-with-vim[/link] – Oolis Mar 19 '16 at 17:37

3 Answers3

12

It looks like your default editor is vi, so proper way to exit editor is: First exit INSERT MODE (press ESC), then type ":wq" and press enter.

To avoid this kind of situation, you can set your default editor, for example:

git config --global core.editor emacs

to set emacs editor. More about git configuration here

erhesto
  • 1,136
  • 9
  • 19
8

You have to do this:

  • write your message
  • ESC + : + w + q
CodeWizard
  • 110,388
  • 20
  • 126
  • 153
0

I think whenever you press Esc button Git-Bash get stuck. I don't know how to avoid that .

However Esc + : + w + q does seem to help a little bit, although most of the time I have to close the window !