强制Git推送SourceForge [英] Force Git push on SourceForge

查看:188
本文介绍了强制Git推送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:连接被拒绝的消息可能意味着:




  • 它可能会在客户端被阻塞(检查是否可以SSH到其他服务,如GitHub,即使它不会是一个交互式会话会话)

  • 或者它可能是SourceForge一方中断的结果(但是它们的


仔细检查 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 the denyNonFastforwards = true to false for a bit, do your push, and then set it back to true (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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆