Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

In my repo in my home directory (on an Ubuntu box) I did

 git fetch

I unfortunately got an error about:

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

There's a gazillion directories in .git/objects and all of them appear to be 775. The few spot checks I did show the files to be 664.

I went and did a

 chmod -R 777 .git/objects 

which fixed the problem but now I've got a bunch of files 777 on my box and I'm sure that's a no-no.

What should the correct permissions be and how can I easily get all 10 million files and directories set correctly?

Thanks in advance.

like image 580
Jistanidiot Avatar asked Oct 25 '12 17:10

Jistanidiot


1 Answers

Are you the owner of all the files?

Try

chown -R you:you .git

Then chmod them to "normal"

chmod -R u=rwX,g=rwX,o=
like image 51
gahooa Avatar answered Sep 24 '22 02:09

gahooa