Git commit asking for comment
If I sometime forget to enter a comment for a git commit operation, then a screen as like follows appear to me:
However, i later on, just can't get rid of this window unless i close and open the command widow again. can anyone ple开发者_JAVA百科ase help my how to handle that scenario ?
Regards
You are in Vim, so just Press Esc to get into command mode.
Then if you want to save the message and commit type:
:wq
or if you want to abandon the commit type:
:q!
If you want to keep a commit, then you need to give it a message.
Do you have a default editor set for Git? Try this (replace nano with your editor of choice):
git config --global core.editor nano
It just opens an editor if you don't supply a commit message. So you'll have to close the editor before you're returned the prompt.
Since it looks like it's using VIM, you can press ESC
then type :wq
which saves and quits the editor.
The problem we're having is that git seems to enter a phase where it does not prompt for a comment. Then something changes, and it always asks for a "merge" comment. We can't pin down what is causing the apparent merge, because we are modifying the files in one place only. The message is:
Please enter a commit message to explain why this merge is necessary, especially if it merges an updated upstream into a topic branch. Lines starting with '#' will be ignored, and an empty message aborts the commit.
A procedure to troubleshoot this would be greatly appreciated.
精彩评论