124

Updates were rejected because the tip of your current branch is behind hint: its remote counterpart. Integrate the remote changes.

I was trying to push local octopress blog to remote branch. But its saying above error.

another is: Do i have to manage or push the local changes to source or origin branch.?

When i do username.github.io ,i shall see my remote version of the local blog.(i used rake deploy command) But i dont see the updated blog at my username.github.io.I have doubt on branch for origin and source.

1
  • I'm adding this because the question mentions Octopress. In my case rake deploy was not working because I had modified the Github repository from the website (in my case adding a CNAME file). What fixed the site publication was doing git pull inside the _deploy/ folder. After that rake deploy was able to publish my changes.
    – jivimberg
    Commented May 9, 2018 at 15:31

1 Answer 1

83

You need to merge the remote branch into your current branch by running git pull.

If your local branch is already up-to-date, you may also need to run git pull --rebase.

A quick google search also turned up this same question asked by another SO user: Cannot push to GitHub - keeps saying need merge. More details there.

8
  • 1
    The important thing is to ensure you're merging the remote branch into your current branch when you do git pull. Commented Apr 14, 2015 at 22:05
  • 96
    git pull says Already-up-to-date but when i do git push origin my-current-local-branch it still gives me the same error mentioned on the title of this thread Commented Oct 31, 2016 at 21:50
  • @Awesome_girl did you fix this? I have the exact same issue, keeps saying my branch is already up-to-date but when I try and git push it says I'm behind
    – twigg
    Commented Feb 28, 2017 at 10:42
  • 10
    git pull --rebase This goes over the same issue. youtu.be/IhkvMPE9Jxs?t=10m36s Commented Mar 24, 2017 at 3:05
  • 14
    thanks your comment worked for me, But when I run git pull --rebase an error There is no tracking information for the current branch. Please specify which branch you want to merge with. See git-pull(1) for details.... so when i ran git branch --set-upstream-to=origin/master master then git pull --rebase worked perfectlly... stupid read me file caused me all that Commented Jan 12, 2018 at 20:30

Not the answer you're looking for? Browse other questions tagged or ask your own question.