2012-09-16 26 views
7

I 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。我的配置文件看起来像这样:Source Forge回购给出了“拒绝非快速转发/头/主”错误

[[email protected] 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://[email protected]/p/bbct/code 
! [remote rejected] master -> master (non-fast-forward) 
error: failed to push some refs to 'ssh://[email protected]/p/bbct/code' 

这是怎么回事?更重要的是,我该如何解决它?

更新:

公共校园计算机上运行git push -f给出与上面相同的错误消息。

另一个更新:

我克隆SF回购到一个临时文件夹,该临时回购的主分支重置为提交之前先用错误的作者和电子邮件提交,然后跑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://[email protected]/p/bbct/code 
! [remote rejected] master -> master (non-fast-forward) 
error: failed to push some refs to 'ssh://[email protected]/p/bbct/code' 

我猜SF真的不希望我做一个非快速向前提交这里:-(

+0

所以这是你的上一个问题相同的错误? – CharlesB

+0

是的,看起来如此。除了现在,我没有得到“权限被拒绝”的错误。我现在也在不同的机器上。 –

+0

原来的机器'push -f'工作,而不是这个? – CharlesB

回答

2

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

+0

我的回答后我没有立即看到您的反馈。 +1 – VonC

16

这可能是一个简单的案件的事:

[receive] 
     denyNonFastForwards = false 

注为“Forwards”大写“F
所以修复Source Forge的服务器上的配置文件,你的git push -f应该会成功,从任何WOR kstation。

+0

ooo ...感谢您指出了这一点。我不记得编辑变量名,但我会仔细检查。 –

+0

嗯,我试过了,仍然得到相同的错误信息。我提交了SF支持票。希望我能尽快听到他们的回复。 –

相关问题