【发布时间】:2012-09-16 21:01:40
【问题描述】:
我rewrote the tree to my git repository to fix errors in the author name and email address。现在我正在尝试将固定树推送到我在 Source Forge 上的存储库。 CharlesB told me how to update the config file on the Source Forge servers。我的配置文件如下所示:
[codeguru@shell-24003 bbct]$ cat config
[core]
repositoryformatversion = 0
filemode = true
bare = true
sharedrepository = 2
[receive]
denyNonFastforwards = false
现在当我尝试强制推送时,出现以下错误:
$ git push -f
Password:
Counting objects: 464, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (148/148), done.
Writing objects: 100% (452/452), 470.65 KiB, done.
Total 452 (delta 268), reused 417 (delta 247)
remote: error: denying non-fast-forward refs/heads/master (you should pull first)
To ssh://codeguru@git.code.sf.net/p/bbct/code
! [remote rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'ssh://codeguru@git.code.sf.net/p/bbct/code'
这里发生了什么?更重要的是,我该如何解决?
更新:
在公共校园计算机上运行 git push -f 会给出与上述相同的错误消息。
另一个更新:
我将 SF repo 克隆到一个临时文件夹,将此临时 repo 的 master 分支重置为第一次提交之前的提交,使用错误的作者和电子邮件,然后运行 git push -f。我收到与原始存储库完全相同的错误消息:
$ git push -f
Password:
Total 0 (delta 0), reused 0 (delta 0)
remote: error: denying non-fast-forward refs/heads/master (you should pull first)
To ssh://codeguru@git.code.sf.net/p/bbct/code
! [remote rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'ssh://codeguru@git.code.sf.net/p/bbct/code'
我猜 SF 真的不希望我在这里做一个非快进提交:-(
【问题讨论】:
-
所以和你上一个问题一样的错误?
-
是的,看起来是这样。除了现在,我没有收到“权限被拒绝”错误。我现在也在另一台机器上。
-
so 在原机
push -f上工作,而不是在这台上? -
@CharlesB
git push -f在任何一台机器上都不起作用。另一台机器上的最新错误在stackoverflow.com/questions/12449230/moving-remote-branch/…底部的“更新”部分中 -
@ron190 感谢您的链接。希望它能对未来的读者有所帮助。
标签: git version-control