#861 - git push -f origin master does not work (Resolved) | Assembla Support Project | Assembla
> Create some bogus commit$ git checkout master
$ touch test
$ git add test
$ git commit -m test
> Push to git repo on assembla
$ git push origin master
> Remove bogus commit
$ git reset --hard HEAD^
> Force git repo on assembla to update
$ git push -f origin master
- Expected outcome:
$ git push -f origin master
Total 0 (delta 0), reused 0 (delta 0)
..
+ .. master -> master (forced update)
From the Git manual:
-f, --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.
(note: this works fine on Github)
- What happens:
Total 0 (delta 0), reused 0 (delta 0)
error: denying non-fast-forward refs/heads/master (you should pull first)
..
! [remote rejected] master -> master (non-fast-forward)
..
error: failed to push some refs to ..
Read full article from #861 - git push -f origin master does not work (Resolved) | Assembla Support Project | Assembla
No comments:
Post a Comment