2

I've reverted to a previous version of my commit then I've done some other commits but without pushing to the remote repo.

When I do push I got the following error:

To git@xxxxxx ! [rejected]        REPO -> REPO (non-fast-forward) error: failed to push some refs to '.....' 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.

Yet, when I do a pull, I get repo up to date. Please help, I cannot integrate my work.

Kara
  • 6,115
  • 16
  • 50
  • 57

1 Answers1

7

git push --force

"Usually, the command refuses to update a remote ref that is not an ancestor of the local ref used to overwrite it. This flag disables the check. This can cause the remote repository to lose commits; use it with care."

Matt Sweeney
  • 2,060
  • 1
  • 14
  • 19