0

I get the error below when trying to push my commit. I have tried pulling then pushing again but it doesn't seem to work.

git -c diff.mnemonicprefix=false -c core.quotepath=false push -v --tags --set-upstream origin master:master
Pushing to https:*"repository"*
To https**"repository"**
 ! [rejected]        master -> master (non-fast-forward)

error: failed to push some refs to *"repository"*
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.
BJ Myers
  • 6,339
  • 6
  • 37
  • 47

2 Answers2

2

You have to use git pull before pushing.

You have to update your local branch with the remote branch before pushing a change to remote.

Peter Mortensen
  • 30,030
  • 21
  • 100
  • 124
Abimaran Kugathasan
  • 29,154
  • 11
  • 70
  • 102
0

git push github master To git@github.com:Joey-project/project.git ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'git@github.com:Joey-project/project.git' has been discussed here before. It's a common error.

If I remember correctly, one has to use a variation of the following commands:

git fetch github; git merge github/master

Perhaps this link can help: Git non-fast-forward updates were rejected Merge the remote changes. It seems related.

Goodluck! I hope it helps you

Community
  • 1
  • 1
Joey Dorrani
  • 371
  • 1
  • 1