3

I have a shared git repository with which we had the problem that pushing led to the error message "insufficient permission for adding an object to repository database ./objects"

I have already read about the solution here: Error pushing to GitHub - insufficient permission for adding an object to repository database and here: Making git push respect permissions? and searched the web for other solutions or similar problems, without success. The repository was not configured with sharedRepository = 0660, but now it is. I also tried "group", "true" and "all" but they did not fix the problem either.

When I do a git push to the remote repository it still creates files with access rights of "-r--r-----". For example the file ./objects/0f/87b18a145ebd187cc1e5bed9f6ea90901bc207 for which ls -l puts out:

-r--r----- 1 rcosta project 166 2012-07-04 20:25 87b18a145ebd187cc1e5bed9f6ea90901bc207

The git config is:

[core]
    repositoryformatversion = 0
    filemode = true
    bare = true
    sharedRepository = 0660

I've reset file permissions using chmod -R g+ws *. I've also done this for all other users that access the project. I am no admin on the system, so each of them logged in and I executed the command. All users belong to the project group.

We access the repository via SSH. Each member's repository has been cloned by executing the command line:

git clone username@uni-server.de:/path/to/projectname.git

I am clueless on how to fix the problem. All files should have read and write permissions for all users of the "project" group, so that everybody can change and push any file.

Thanks for any help!
Robert.

Community
  • 1
  • 1
zabbarob
  • 1,191
  • 4
  • 16
  • 25

1 Answers1

0

I would run the following command on the remote repo:

    git config core.filemode false

This should prevent git from identifying changes in ownership/permissions. I see in the config you supplied filemode is set to true, this means that when files are pushed to the remote the permissions are being pushed as well.

I would at least start there.

frosty
  • 769
  • 6
  • 18
  • Thanks for the answer. Unfortunately this didn't fix the problem, the permissions of the changed files in ./objects are still set to "-r--r-----". :-( I also tried cloning the repo again and pushing something, which produced the same results. I also tried cloning and changing something directly on the server (to check if the error is due to ssh) but I still get the same permissions. Meanwhile I also figured out that the directory is mounted on the server with nfs (rw,nosuid,nodev,tcp,hard,intr,lock,sloppy,addr=131.173.33.194), but I don't know if this might produce the problem... – zabbarob Jul 05 '12 at 00:50