Git rejection without conflict

I read a few explanations for a broken git push, but none of them seem to cover this case.

I cannot redirect my local changes to a remote repository even after pulling out and without conflicts.

$ git pull
Already up-to-date

$ git st
# On branch unstable
nothing to commit (working directory clean)

$ git push
To ssh://<url>
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'ssh://<url>'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes (e.g. 'git pull') before pushing again.  See the
'Note about fast-forwards' section of 'git push --help' for details.

<url> - This, of course, is the real URL of my repository.

There are no changes in pull, there are no conflicts, and I'm not sure what else could lead to failure.

I believe that everything is correctly configured:

$ git remote -v
origin  ssh://<url> (fetch)
origin  ssh://<url> (push)

$ git branch -v
  master   175a09d [behind 18] openReview must now be called from thread other than main.
* unstable c9e5cab Progress on attachments.

In the past, I just deleted my local repository. However, this happens more often.

  • What caused this?
  • How can I avoid this in the future?
  • How can i fix this?
+5
source share
3 answers

Full disclosure - my git is a little rusty, so it may not be 100% correct.

, "" "origin". 'git push', . , git push origin unstable. , , , git pull.

+4

Git , . , , , .

,

git push -f #Warning, this will essentially clobber revisions on origin with your local revisions.

, " ". Git HEAD . , ( , ), .

+1

, " ". , git push --help " ", , , . , , git push --force, .

0

All Articles