Subject: Re: Git force push fails after a rejected push (unpack failed)?

From: Jeff King <[email-masked]>
Date: Tue, 7 Jul 2015 10:13:06 -0400

On Tue, Jul 07, 2015 at 03:45:50PM +0200, X H wrote:

> remote: error: unable to write sha1 filename objects/d9/4bfb39cd0be7497e493bd4045111a7b1158134: Permission denied
> remote: fatal: failed to write object
> error: unpack failed: unpack-objects abnormal exit

It looks like the permissions of one or more of the .git/objects/*
directories on the server is not right. Just a guess, but this may be
because you have multiple accounts pushing to it, and need to set umasks
or use git's core.sharedrepository config to set the permissions for
each object.

You'll probably have to ssh to the server and "chown" or "chmod" some
directories to fix it in the first place, though.

> Is it the intended behaviour? I try to reproduce this and it seems it
> doesn't happen always.

Probably only some object directories have the problem, so it would
depend on the set of exact objects you are sending, and possibly even
the number of objects (if you send a large number of objects, git will
store them as a pack, not as loose objects).

-Peff