Reputation: 12945
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
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