1

If I sometime forget to enter a comment for a git commit operation, then a screen as like follows appear to me:

enter image description here

However, i later on, just can't get rid of this window unless i close and open the command widow again. can anyone please help my how to handle that scenario ?

Regards

1

4 Answers 4

7

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.

Sign up to request clarification or add additional context in comments.

Comments

4

Do you have a default editor set for Git? Try this (replace nano with your editor of choice):

git config --global core.editor nano

3 Comments

@eckes: And obviously he doesn't know how to use Vim, so he doesn't want it to be Vim.
Not obviously. I don't explore the command line much and don't have experience with Vim, so I wasn't sure (also I didn't see VIM in the title bar 'til now), Hence I suggested he set a default editor in case he hadn't yet.
I didn't mean to offend you. But in the upper left corner of the window, the Vim logo is visible. Going to delete my original comment...
0

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.

Comments

0

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.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.