Source Forge repo给出了“拒绝非快进refs / heads / master”错误

时间:2012-09-16 21:01:41

标签: git version-control

rewrote the tree to my git repository to fix errors in the author name and email address。现在,我正在尝试将固定树推送到Source Forge上的repo。 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的主分支重置为提交,然后运行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真的不希望我在这里做非快进提交: - (

2 个答案:

答案 0 :(得分:17)

这可能是一个简单的案例:

[receive]
        denyNonFastForwards = false

请注意“F”的大写字母“Forwards” 因此,在Source Forge服务器上修复配置文件,并且git push -f应该从任何工作站成功。

答案 1 :(得分:3)

嗯,这实际上是一个SourceForge问题,也许也是一个用户错误。在SF shell中,我最初编辑了/home/scm_git目录下项目的配置文件。在向SF提交票证后,我发现正确的目录是/home/git。在我的项目的正确子目录中编辑配置文件后,我强制推送并成功更新了主分支。

相关问题