【发布时间】:2012-08-06 14:06:46
【问题描述】:
我正在尝试撤消已经推送到远程存储库的一些更改,并且我已经在本地使用
git reset --hard COMMIT-HASH
但现在它不会让我不先拉就推,这当然违背了目的。我试过了:
git push -f
出现哪些错误:
Total 0 (delta 0), reused 0 (delta 0)
remote: error: denying non-fast-forward refs/heads/master (you should pull first)
To git@xxx.beanstalkapp.com:/yyy.git
! [remote rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'git@xxx.beanstalkapp.com:/yyy.git'
那么我如何将新的、正确版本的分支转移到远程?
【问题讨论】:
-
this 对您有帮助吗?
-
@Hassan - 对不起,不。我已经回滚了我不想要的提交,现在问题是成功将其推送到远程。
-
如果你已经回滚了 git 服务器上的提交,那为什么不能拉取呢?
标签: git