Tuesday, October 20, 2009

git insufficient permission for adding an object to repository database ./objects

this is a shared group repository
so i had to enter the repository dir and make sure group can write into it

ssh to server
cd repository.git

sudo chmod -R g+ws *
sudo chgrp -R mygroup *

git repo-config core.sharedRepository true

and the try to push origin master again

14 comments:

  1. Hey,
    I still cannot make it work.

    This is my config file on the repo:

    [core]
    repositoryformatversion = 0
    filemode = true
    bare = true
    sharedRepository = true
    [receive]
    denyNonFastforwards = true

    and when I "git push", I get the following:

    Delta compression using up to 2 threads.
    Compressing objects: 100% (3/3), done.
    Writing objects: 100% (3/3), 294 bytes, done.
    Total 3 (delta 2), reused 0 (delta 0)
    error: insufficient permission for adding an object to repository database ./objects

    fatal: failed to write object
    error: unpack failed: unpacker exited with error code
    ...

    I have created a git user and group for the repo, and then normal users need to be added to the git group to use it and that's it.

    Could you please help with this? Thanks a lot


    PS. I'm working locally, but that shouldn't make a difference.

    ReplyDelete
  2. check the permissions for object files
    so that others have rights inside the repository

    git group should be rw

    ls -lah .git/objects

    ReplyDelete
  3. Worked beautifully.

    ReplyDelete
  4. This fixed my issue.

    ReplyDelete
  5. Thanks! This fixed this for me as well.

    ReplyDelete
  6. thanks! it worked for me too

    ReplyDelete
  7. Great article.
    I didn't set chgrp so the error message didn't disappear.

    ReplyDelete
  8. great article, no I can look relaxed to the weekend

    Marcus

    ReplyDelete
  9. That'll do. Thank you!

    ReplyDelete
  10. even i have the rw option in my account still this is not work for me

    ReplyDelete
  11. insufficient permission for adding an object to repository database ./obj

    even i have the rw option in my account but still have the problem

    ReplyDelete