强制Git推送SourceForge [英] Force Git push on SourceForge
问题描述
我试图在SourceForge上回滚一个Git仓库。我尝试了以下方法:
git reset --hard 9ac2e31ca4a155d4c36780b4329626045a7f40ed
HEAD ist jetzt bei 9ac2e31修复警告
git push -f原点大师
总计0(delta 0),重用0(delta 0)
remote:错误:拒绝非快进refs / heads / master (你应该先拉)
到ssh://user@git.code.sf.net/p/project/code
! [remote rejected] master - > master(非快进)
错误:Fehler beim Versenden einiger Referenzen nach'ssh://user@git.code.sf.net/p/project/code'
如何覆盖远程SourceForge Git存储库的 master
分支
由于 denyNonFastforwards
是服务器端配置,您需要访问您的以某种方式在SourceForge一侧回购。
由于您的票证提及,这是通过交互式shell服务,但是假设你可以使用ssh打开一个安全的shell。
lockquote>
在shell中运行 sf-help --scm
会显示给你你的回购路径。
只需稍微调整 denyNonFastforwards = true
至 false
然后将它设置回 true
(为了安全起见)。
然而,像 ssh:连接到主机shell.sourceforge.net端口22:连接被拒绝
的消息可能意味着:
仔细检查 SourceForge SSH文档。
I'm trying to rollback a Git repository on SourceForge. I tried the following:
git reset --hard 9ac2e31ca4a155d4c36780b4329626045a7f40ed
HEAD ist jetzt bei 9ac2e31 Fix warnings
git push -f origin master
Total 0 (delta 0), reused 0 (delta 0)
remote: error: denying non-fast-forward refs/heads/master (you should pull first)
To ssh://user@git.code.sf.net/p/project/code
! [remote rejected] master -> master (non-fast-forward)
error: Fehler beim Versenden einiger Referenzen nach 'ssh://user@git.code.sf.net/p/project/code'
How can I override the master
branch for a remote SourceForge Git repository?
Since denyNonFastforwards
is a server-side config, you need to access to your repo on the SourceForge side somehow.
As your ticket mentions, this is done with an interactive shell service, but that supposes you can use ssh to open a secure shell.
Running "
sf-help --scm
" in the shell will show you your repo paths.
Just tweak thedenyNonFastforwards = true
tofalse
for a bit, do your push, and then set it back totrue
(for safety).
However, a message like "ssh: connect to host shell.sourceforge.net port 22: Connection refused
" could mean that:
- It could be blocked on the client side (check if you can ssh to other services, like GitHub, even though it won't be an interactive session)
- or it could be the result of an outage on SourceForge side (but their status page doesn't report any recent incident)
Double-check the SourceForge SSH documentation.
这篇关于强制Git推送SourceForge的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!