Remove remote commit in git -
i can't find working solution problem:
how remove commit in local , in remote repository. here 1 solution. when try can go reset
command in local repository. can't push it. error message says: remote: error: denying non-fast-forward refs/heads/master (you should pull first)
after pull
master points again commit want remove.
can help?
edit - try:
$ git reset --hard head^1 head @ 1c50f9c commit $ git push -f total 0 (delta 0), reused 0 (delta 0) remote: error: denying non-fast-forward refs/heads/master (you should pull first) e:/reps/gf.git ! [remote rejected] master -> master (non-fast-forward) error: failed push refs 'e:/reps/gf.git'
your remote repository has setup disallows non-fast-forward pushes on server side. have 2 options:
contact server administrators, explain case, , ask them (temporarily) rescind no-fast-forward-push policy,
git config receive.denynonfastforwards
. (you still need-f
flag push.)use
git revert
instead ofgit reset
, , push resulting commit. both commit , inverse visible, cannot avoided. unless original commit contains sensitive data, should big deal—git commits reverted time. if original commit contain sensitive data, see option 1.
Comments
Post a Comment