user1072337
user1072337

Reputation: 12945

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

I am trying to push a Ruby on Rails repo to github, and just today it is giving me the following error:

******-*********:myapp *************$ git add .
error: insufficient permission for adding an object to repository database .git/objects
error: test/helpers/sessions_helper_test.rb: failed to insert into database
error: unable to index file test/helpers/sessions_helper_test.rb
fatal: adding files failed

This has just started occurring (things were working fine yesterday). What could have changed and how do I solve this? Thank you.

Upvotes: 2

Views: 14367

Answers (1)

jherran
jherran

Reputation: 3367

Review the permissions on .git directory.

To change all perms, you could execute the following:

sudo chown -R your-username:staff .git

Then you should be able to add files.

Upvotes: 22

Related Questions