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.

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=

Need Your Help

Why is allocation on the heap faster than allocation on the stack?

c++ stack heap new-operator automatic-storage

As far as my knowledge on resource management goes, allocating something on the heap (operator new) should always be slower than allocating on the stack (automatic storage), because the stack is a ...