• 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.

8 4 2
2,300 points

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.

5 2 1
4,980 points

Related questions

0 votes
1 answer 116 views
Problem : How can I ignore the below error message on the Git pull? Your local changes to the following files would be overwritten by merge What if I just want to overwrite them? I Have already tried many things like git pull -f, but nothing really works for me.To be very clear, I just want to overwrite the specific changes and not the everything.
asked Jan 2 alecxe 7.5k points
0 votes
1 answer 10 views
Problem: I have basic knowledge of GIT. Whenever I try to pull in my project directory in my terminal then I face the below error: /Sites/branch1$ git pull origin master U app/config/app.php U app/config/database.php U app/routes.php Pull is not possible because you have ... 'git commit -a'. Why does my git is showing me above error? and how can a beginner like me fix above git pull error?
asked Aug 27 Raphael Pacheco 4.9k points