gpt4 book ai didi

git - Sourceforge repo 给出 "denying non-fast-forward refs/heads/master"错误

转载 作者:太空狗 更新时间:2023-10-29 12:49:45 25 4
gpt4 key购买 nike

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'

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

更新:

在公共(public)校园计算机上运行 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://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 真的不想让我在这里做一个非快进提交:-(

最佳答案

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

[receive]
denyNonFastForwards = false

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

关于git - Sourceforge repo 给出 "denying non-fast-forward refs/heads/master"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12450703/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com