I have had this issue recently, with a git branch which did not want to to react to push. That's what a was having:
$ git firstname.lastname@example.org's password Counting objects: 5, done.
Delta compression using up to 2 threads.
ng objects: 100% (3/3), done.
Writing objects: 100% (3/3), 303 bytes, done.
Total 3 (delta 2), reused 0 (delta 0)
error: unable to create temporary sha1 filename ./objects/17: Permission denied
fatal: failed to write object
error: unpack failed: unpacker exited with error code
! [remote rejected] HEAD -> master (n/a (unpacker error))
error: failed to push some refs to 'git@server:/var/www/git/domain'
The problem is a permissions one... but it will not work if you try to update the permissions in the server folder. You have to update the permissions in the server, but in .git folder:
chown -R git:git .git/
In my case git was the user who should have the permissions to write.
Once changed, the push in your local environment should work.