Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Force Git push on SourceForge

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://[email protected]/p/project/code
 ! [remote rejected] master -> master (non-fast-forward)
error: Fehler beim Versenden einiger Referenzen nach 'ssh://[email protected]/p/project/code'

How can I override the master branch for a remote SourceForge Git repository?

like image 655
BuZZ-dEE Avatar asked Jul 26 '15 19:07

BuZZ-dEE


1 Answers

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.

like image 117
VonC Avatar answered Sep 20 '22 23:09

VonC