4

After rewriting the commit tree to rename the author and change the email, my local repo and remote origin are out of sync. I am the only developer and want to push my local repo to origin, updating origin/master to my local master branch. Here's what I have tried without any success:

LibGuest08@LBP-NW0345QZMH1 /e/devel/src/java/bbct (swing.0.5.2)
$ git push
Password:
To ssh://codeguru@git.code.sf.net/p/bbct/code
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'ssh://codeguru@git.code.sf.net/p/bbct/code'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. If you did not intend to push that branch, you may want to
hint: specify branches to push or set the 'push.default' configuration
hint: variable to 'current' or 'upstream' to push only the current branch.

LibGuest08@LBP-NW0345QZMH1 /e/devel/src/java/bbct (swing.0.5.2)
$ git push origin master:master
Password:
To ssh://codeguru@git.code.sf.net/p/bbct/code
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'ssh://codeguru@git.code.sf.net/p/bbct/code'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and merge the remote changes
hint: (e.g. 'git pull') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

LibGuest08@LBP-NW0345QZMH1 /e/devel/src/java/bbct (swing.0.5.2)
$ git push -f origin master:master
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'

LibGuest08@LBP-NW0345QZMH1 /e/devel/src/java/bbct (swing.0.5.2)
$

I also pulled origin as suggested, but that does a merge with all the commits, some of which have the wrong author name and email. How do I sync my remote origin repo with my local repo and prune out all the commits with bad meta-data?

Update:

I edited the config file in the Sourceforge repo. I am still getting an error message, but I noticed a different line:

lib_lab_ref08@LBP-REF87XVMDP1 /e/devel/src/java/bbct (master)
$ 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)
fatal: Unable to create temporary file: Permission denied
error: unpack failed: index-pack abnormal exit
To ssh://codeguru@git.code.sf.net/p/bbct/code
 ! [remote rejected] master -> master (n/a (unpacker error))
error: failed to push some refs to 'ssh://codeguru@git.code.sf.net/p/bbct/code'

What does

fatal: Unable to create temporary file: Permission denied
error: unpack failed: index-pack abnormal exit

mean? More importantly what do I do to fix this?

After thought:

I am using a public computer. I recently compressed my repo database and I am guessing that I don't have permission to write to the temporary folder where git is unpacking the compressed repo objects during the push. I will try this on a computer without these security restrictions and see what happens.

Community
  • 1
  • 1
Code-Apprentice
  • 81,660
  • 23
  • 145
  • 268

1 Answers1

6

There's a setting on the remote repository that prevents (and it's a good thing) non-fast-forward pushes, that is the type of push you're doing.

As you point out you're safe to do non-ff push because you're the only one to work with it, so see this blog post to see how to change it:

  1. log into ssh shell with ssh -t USER,PROJECT@shell.sourceforge.net create
  2. navigate to the git repo: cd to /home/git/p/<project_name>/code.git (filling in the correct project name)
  3. edit the config file with vi and set denyNonFastforwards to false
CharlesB
  • 86,532
  • 28
  • 194
  • 218
  • hmm...I'm still getting the same error message. I'll update my question. – Code-Apprentice Sep 16 '12 at 18:47
  • Do you have any idea when git reads the config file? Does the remote repo need some kind of refresh in order to see the changes I have made? The only other possibility I can think of is that SF ignores my personal config file, or maybe just the options that I'm playing with. – Code-Apprentice Sep 17 '12 at 00:30
  • sorry no idea; try to set it to true again, and back to false, or to test the same stuff on another repo, but I'm out of ideas now. Also try SF support with lots of details, but don't expect speed, it's FOS! Anyway update your posts with anything new – CharlesB Sep 17 '12 at 05:44
  • I decided to wait and try again today. If it still doesn't work, SF support is my next course of action. Thanks again for all your help. I'll let you know what I find out from them. – Code-Apprentice Sep 17 '12 at 19:30