I am attempting to evaluate git for the team and among the needs is by using HTTPS because the transport method. I have been attempting to stick to the git-http-after sales documentation in addition to some sparse blogs on setting this up while using new Wise HTTP transport, but am simply not setting it up working. I understand it's most likely something stupid, but I have racked my brain regarding this with no success. Don't assume any real understanding with git, I am pretty a new comer to the tool.

At this time I'm able to clone over HTTP all right, however when I attempt and push, the customer will get:

$ git push
Counting objects: 4, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 291 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
error: unpack failed: unpack-objects abnormal exit

The server Apache error log states:

error: inadequate permission for adding an item to repository database ./objects

fatal: unsuccessful to create object

Apache config:

SetEnv GIT_PROJECT_ROOT /opt/git
ScriptAlias /git/ /usr/libexec/git-core/git-http-backend/

<Location /git>
        AuthType Basic
        AuthName "Private Git Access"
        Require valid-user
        AuthUserFile /opt/git/passwords

Clearly my first thought was file permissions, and so i did a fast chown -R apache: /opt/git

# ls -l /opt/git
drwxr-xr-x. 7 apache apache 4096 Aug 12 11:06 project.git

However I get exactly the same error.

Thanks, I greatly appreciate any help I jump on this.

The answer is most likely within the group permissions from the repository around the server.

  1. compact disc to /opt/git
  2. sudo chgrp -R apache project.git

I factor apache usually runs as www-data, not apache, therefore the group might be wrong also

I personally use gitosis and manage accounts through server accounts rather than Apache, but solved my same issue with this particular type of solution

Try running:

git repo-config core.sharedRepository true

This had solved similar problem for me personally. In the paperwork:


If true, the repository is created shareable between several customers inside a group (ensuring all of the files and objects are group-writable).

Are you able to verify the steps as given here ( this really is certainly a permissions / groups problem):