OS: Windows
I write
$ git commit
then
"# Please enter the commit message"
I write some text, like
"Form validation added"
Press Enter and not commited. Then i press Shift+Enter, Ctrl+Enter, Alt+Enter - still not commited.
I think its stupid trouble, but What i must to do?
Have you tried just going: git commit -m "Message here"
So in your case:
After you've added your files of course.
Typically,
git commit
brings up an interactive editor (on Linux, and possibly Cygwin, determined by the contents of your$EDITOR
environment variable) for you to edit your commit message in. When you save and exit, the commit completes.You should make sure that the changes you are trying to commit have been added to the Git index; this determines what is committed. See http://gitref.org/basic/ for details on this.
You can change the comment character to something besides # like this:
I am assuming you are using msys git. If you are, the editor that is popping up to write your commit message is vim. Vim is not friendly at first. You may prefer to switch to a different editor. If you want to use a different editor, look at this answer: How do I use Notepad++ (or other) with msysgit?
If you want to use vim, type
i
to type in your message. When happy hit ESC. Then type:wq
, and git will then be happy.Or just type
git commit -m "your message here"
to skip the editor altogether.If it is VIM for Windows, you can do the following:
:wq
Enter orZZ
.Note that in VIM there are often several ways to do one thing. Here there is a slight difference though.
:wq
Enter always writes the current file before closing it, whileZZ
,:x
Enter,:xi
Enter,:xit
Enter,:exi
Enter and:exit
Enter only write it if the document is modified.All these synonyms just have different numbers of keypresses.