Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Source Forge repo gives "denying non-fast-forward refs/heads/master" error

I rewrote the tree to my git repository to fix errors in the author name and email address. Now I'm trying to push the fixed tree to my repo on Source Forge. CharlesB told me how to update the config file on the Source Forge servers. My config file looks like this:

[codeguru@shell-24003 bbct]$ cat config
[core]
        repositoryformatversion = 0
        filemode = true
        bare = true
        sharedrepository = 2
[receive]
        denyNonFastforwards = false

Now when I try to force a push, I get the following error:

$ 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'

What's going on here? More importantly, how do I fix it?

Update:

Running git push -f on a public campus computer gives the same error message as above.

Another Update:

I cloned the SF repo to a temporary folder, reset this temporary repo's master branch to the commit just before the first commit with the wrong author and email, then ran git push -f. I get the exact same error message as with my original repo:

$ 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'

I guess SF really doesn't want me doing a non-fast-forward commit here :-(

like image 585
Code-Apprentice Avatar asked Sep 16 '12 21:09

Code-Apprentice


2 Answers

It could be a simple matter of case:

[receive]
        denyNonFastForwards = false

Note the uppercase 'F' for 'Forwards'.
So fix your config file on the Source Forge servers, and your git push -f should succeed, from any workstation.

like image 173
VonC Avatar answered Nov 19 '22 19:11

VonC


Well, this was in fact a SourceForge issue, and perhaps a user error as well. In the SF shell, I originally edited the config file for my project under the /home/scm_git directory. After submitting a ticket to SF, I found out that the correct directory is /home/git instead. After editing the config file in the correct subdirectory for my project, I forced a push and updated the master branch successfully.

like image 28
Code-Apprentice Avatar answered Nov 19 '22 19:11

Code-Apprentice