Take the 2-minute tour ×


I merged a branch in a master not updated at last commit.

What I do

I merged a branch in master

git merged BRANCHNAME


Automatic merge failed; fix conflicts and then commit the result.

git commit -a -m "Resolved conflicts while merging email-fix branch"

Then I tried to push all to origin master, but it says:


How can I solve this problem?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

You can do:

  • a git pull --rebase, in order to replay your merge on top of an up-to-date master branch
  • then a git push (which should go smoothly)

The other alternative would be to force the push, which would mean loosing the recent history on the remote master: not a very good idea.

Both alternatives are presented in the Git FAQ, although only a simple git pull is advocated.
The git push man page mentions the git pull --rebase:




      B   D
     /   /


share|improve this answer
Thank you for your reply. I solved the problem ;) –  zetareticoli Oct 28 '10 at 12:45

Your Answer


