14

I've done git pull. After that I got this message:

# 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.
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
".git/MERGE_MSG" 7L, 302C

My question is - what do I need to do here? because I can't typing any message.

cregox
  • 17,674
  • 15
  • 85
  • 116
Matrosov Oleksandr
  • 25,505
  • 44
  • 151
  • 277
  • 4
    This is not really Git problem. It's the editor, vi. Git uses whatever is set as default editor (e.g. with environment variables `EDITOR` or `VISUAL`) by default. Either set a different one or get comfortable with vi. – Koraktor Jan 31 '13 at 09:48
  • Regarding `Vim`: http://stackoverflow.com/questions/4708645/vim-for-windows-what-do-i-type-to-save-and-exit-from-a-file/4729480#4729480 – eckes Mar 14 '13 at 19:53

2 Answers2

29

It seems you are now in vi or vim.

press i, then input your merge message.

Then esc, and :wq

pktangyue
  • 8,326
  • 9
  • 48
  • 71
4

You are probably using VI as your editor. You can do two things: press 'i', or 'a', and you will be entering type mode, which can be exited using the ESC key, and then press ':wq', or 'ZZ', which will save the file.

An alternative is probably to use the -m switch on the command line, which will allow you to skip this screen, and supply a message immediately (-m "My message here")

Erik Pragt
  • 13,513
  • 11
  • 58
  • 64