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

Hey @Tim, it looks like I’m having the same problem mentioned in this thread in my project web-sonify. I noticed it when I tried to pull my project to local, and realized HEAD was way behind, so when I brought up the glitch console to commit (there are a lot of unstaged changes, untracked files), I get this:

$ git add -A
error: insufficient permission for adding an object to repository database .git/objects
error: src/index.js: failed to insert into database
error: unable to index file src/index.js
fatal: updating files failed

Doing some research online, I see this might be caused by a permissions problem in .git/objects, so trying to fix things I get:

$ chmod -R g+rwX .
chmod: changing permissions of './.git/objects/pack/pack-31dffcfa5f0ea052845583fc6e1d0f8fb0034d04.pack': Operation not permitted
chmod: changing permissions of './.git/objects/pack/pack-31dffcfa5f0ea052845583fc6e1d0f8fb0034d04.idx': Operation not permitted
chmod: changing permissions of './.git/objects/e5': Operation not permitted

and maybe 100 more lines. I realize that this might be by design.

My project is quite old, but it looks like the last successful commits were pushed from local, so totally possible that I caused this problem myself.

Anything I can try? Thanks!