Kenta
Kenta

Reputation: 391

Git Push error - insufficient permission

I have been working in this git repo for a few weeks now, and have been the only one using it. A previous worker set everything up and then handed it down to me later after he moved on. Everything has been working fine, until one day I was making a new change and went to git push and got this error

Counting objects: 5, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 442 bytes | 0 bytes/s, done.
Total 5 (delta 4), reused 0 (delta 0)
remote: error: insufficient permission for adding an object to repository database ./objects
remote: fatal: failed to write object
error: unpack failed: unpack-objects abnormal exit
To git@myserver:/path/to/repo.git
 ! [remote rejected] master -> master (unpacker error)
error: failed to push some refs to 'git@myserver:/path/to/repo.git'

I looked into this and found some solutions people were giving. So I found this:

ssh me@myserver
cd repository/.git

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

git config core.sharedRepository true

But, I do not know what mygroup is, and I am not sure of how to find what that name is. Are there any other solutions to this problem or can someone show me how to find the group name? Thanks.

Upvotes: 1

Views: 3361

Answers (1)

Jonathan.Brink
Jonathan.Brink

Reputation: 25373

On Unix-like systems each user can belong to any number of "groups". (This is an OS-level concept, not a Git concept).

Assuming you are on a unix-like system, to determine which groups you belong to use the command:

groups

If you know which one of the resulting groups to use, then use that for the chgrp command.

But, if you are in a situation where you have a system administrator, it would be best to ask them which group your team should use for Git. If you do not belong to that group open a ticket to have yourself included.

Upvotes: 1

Related Questions