Not enough permission Clicking on Git Common repo for Smart HTTP

I am trying to evaluate git for our team, and one of the requirements is to use HTTPS as a transport method. I am trying to complete the git-http-backend documentation, as well as some rare blogs when setting up using the new Smart HTTP transport, but am just not getting it. I know that this is probably something stupid, but I tried my brain on this subject to no avail. Don't take any real knowledge with git, I'm pretty new to this tool.


Right now, I can just clone HTTP, but when I try to push, the client gets:

$ git push Username: Password: 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 Apache server error log states:

error: insufficient permission to add an object to the repository database. / objects

fatal: could not write object


Apache configuration:

 SetEnv GIT_PROJECT_ROOT /opt/git SetEnv GIT_HTTP_EXPORT_ALL ScriptAlias /git/ /usr/libexec/git-core/git-http-backend/ <Location /git> AuthType Basic AuthName "Private Git Access" Require valid-user AuthUserFile /opt/git/passwords </Location> 


Obviously, my first thought was to resolve the file, so I made a quick chown -R apache: / opt / git

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

But I still get the same error.

Thank you, I really appreciate any help I can get from this.

+4
source share
2 answers

Try to run:

 git repo-config core.sharedRepository true 

This resolved me a similar problem. From the docs:

core.sharedRepository

If true, the repository becomes available between several users in the group (make sure that all files and objects are written to groups).

Can you check the steps listed here (this is definitely a permissions / group issue):

http://parizek.com/?p=177

+1
source

The solution is probably included in the group permissions of the repository on the server.

  • cd to / opt / git
  • sudo chgrp -R apache project.git

I believe that apache usually works like www-data, not apache, so the group may be wrong and

I use gitosis and manage accounts through server accounts instead of Apache, but solved the same problem with this solution

+1
source

All Articles