• Register
0 votes

Problem :

I have recently started using Git. I am still learning about Git. I tried to do the pull from the remote repository. But now I am facing below error message:

"Please enter a commit message to explain why this merge is necessary, especially if it merges an updated upstream into a topic branch."

I have already tried to type the message and also pressed the Enter button but nothing is really happening for me.

How can I fix the above error message.

I am currently learning to use terminal on the OS X.

2.3k points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

I have gone through your question. Its common question asked by Git beginners.

Let me explain you why the Git is asking for the commit message to you now: I can think about 3 possible reasons behind it:

You must have updated your git client recently.

Or you might never had the local branch which was ahead of a remote before.

Or you must have changed the git config very recently.

As your local repository is ahead by one commit now the git tries to merge the remote to the local repo. This procedure can be done with the help of merge but particularly in your case, I guess you are looking for the rebase means you want to add your commit to the top. This  can be achieved with below command:

git rebase or git pull –rebase

Hope it fixes your issue.

5k points