1

I am new to git, and stuck while committing a file, and not able to type anything,below is message comes:


# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch master
# Changes to be committed:[enter image description here][1]
#       modified:   file_1.txt
chepner
  • 497,756
  • 71
  • 530
  • 681
Aditya
  • 11
  • 1
  • 2
    it seems you have more a problem of vi than git. you can do commit by typing `git commit -m'your message'` – olibiaz Sep 13 '16 at 14:34
  • I suggest you check this answer out if you don't like using vim. http://stackoverflow.com/questions/2596805/how-do-i-make-git-use-the-editor-of-my-choice-for-commits – arjabbar Sep 13 '16 at 14:44
  • 2
    Set the `EDITOR` environmental variable to whatever editor you are most comfortable with, the you can write your `commit` message there. – xxfelixxx Sep 13 '16 at 15:28

2 Answers2

2

I think this is really more of a VIM issue than a Git one.

Press SHIFT + I to enter insert mode.

Then enter your commit message. To save your work and exit this screen, type:

ESC

to leave edit mode, followed by:

:wq

This should complete the commit and return you to the prompt of your Git bash. As @olibiaz mentioned, you could also try using:

git commit -m 'your commit message here'

in which case Git would not bring up the VIM editor.

Tim Biegeleisen
  • 502,043
  • 27
  • 286
  • 360
0

Press i for inserting. Once you are done editing the messages, you can press esc -> :wq -> enter to save and quit.