Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

got a git merge issue after git pull

Tags:

git

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.

like image 524
Matrosov Oleksandr Avatar asked Jan 31 '13 09:01

Matrosov Oleksandr


People also ask

Why does Git merge when I pull?

git pull causes merge commits because git is merging. This can be changed by setting your branches to use rebase instead of merge. Using rebase instead of merge on a pull provides a more linear history to the shared repository. On the other hand, merge commits show the parallel development efforts on the branch.

How do you resolve pull request can't be merged?

Checkout via command line If you cannot merge a pull request automatically here, you have the option of checking it out via command line to resolve conflicts and perform a manual merge. Step 1: From your project repository, check out a new branch and test the changes. Step 2: Merge the changes and update on origin.


2 Answers

It seems you are now in vi or vim.

press i, then input your merge message.

Then esc, and :wq

like image 118
pktangyue Avatar answered Sep 28 '22 08:09

pktangyue


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")

like image 40
Erik Pragt Avatar answered Sep 28 '22 08:09

Erik Pragt