Vim で Git コミット メッセージを入力する際の問題 質問する

Vim で Git コミット メッセージを入力する際の問題 質問する

OS: Windows

私は書きます

$ git commit

それから

「# コミットメッセージを入力してください」

次のような文章を書きます

「フォーム検証が追加されました」

Enter キーを押してもコミットされません。次に、Shift+Enter、Ctrl+Enter、Alt+Enter を押しましたが、まだコミットされません。

馬鹿げたトラブルだと思うけど、何をすればいいの?

ベストアンサー1

Windows 用の VIM の場合は、次の操作を実行できます。

  • 提示されたガイドラインに従ってメッセージを入力してください
  • Esc挿入モードから抜けていることを確認するために押してください
  • then type :wqEnter or ZZ.

Note that in VIM there are often several ways to do one thing. Here there is a slight difference though. :wqEnter always writes the current file before closing it, while ZZ, :xEnter, :xiEnter, :xitEnter, :exiEnter and :exitEnter only write it if the document is modified.
All these synonyms just have different numbers of keypresses.

おすすめ記事