Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 748
YaSh Chaudhary Avatar asked Jan 25 '26 11:01

YaSh Chaudhary


2 Answers

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

like image 73
ckruczek Avatar answered Jan 27 '26 00:01

ckruczek


You must grab the latest change from the the remote before you can push yours. This is what you did with the git pull --rebase but it look like it did not work.

Have you verified that the pull was successful?
The you did not had any conflicts?

try this pull without rebase first and see if its working

git pull origin master

Than you can pull again with --rebase

git pull --rebase origin master

Then do a push

git push origin master
like image 25
CodeWizard Avatar answered Jan 27 '26 00:01

CodeWizard



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!