To handle the following problem use the following steps.
press "i"
write your merge message
press "esc"
write ":wq"
then press enter