9

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
  • 15,711
  • 14
  • 77
  • 111
Matrosov Alexander
  • 20,713
  • 42
  • 130
  • 259
  • 3
    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

19

It seems you are now in vi or vim.

press i, then input your merge message.

Then esc, and :wq

pktangyue
  • 7,546
  • 7
  • 43
  • 70
3

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
  • 11,804
  • 10
  • 44
  • 55