Git error: ! [rejected] master -> master (non-fast-forward)

YaSh Chaudhary picture YaSh Chaudhary · Mar 8, 2017 · Viewed 15.6k times · Source

I was updating my project and when tried to upload it to my repository,got the following error:

Already did

git pull --rebase origin master

  ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'https://*******/production.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

I need to update my website but not able to do so.

EDIT 1:

> git status gives:

rebase in progress; onto cda02b2 You are currently rebasing branch 'master' on 'cda02b2'. (all conflicts fixed: run "git rebase --continue")

nothing to commit, working directory clean

Answer

ckruczek picture ckruczek · Mar 8, 2017

As git tells you in the output It seems that there is already a rebase-apply directory, and I wonder if you are in the middle of another rebase. If that is the case, please try git rebase (--continue | --abort | --skip) you are in the middle of a rebase. You first have to abort or continue this rebase by

git rebase --continue or

git rebase --abort

and then pull again with

git pull --rebase origin master