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

I was getting below error for the first time while committing the code to git

Deepaks-MacBook-Pro:cm deepakyadav$ git commit -m 'so far'
error: insufficient permission for adding an object to repository database .git/objects
error: insufficient permission for adding an object to repository database .git/objects
error: Error building trees

 

SOLUTION: run following CHOWN command in the same console path.

Deepaks-MacBook-Pro:cricmedia deepakyadav$ sudo chown -R deepakyadav .

So it will change the user[here ‘deepakyadav’ is the username with admin privileges] privilege. And this error should not come again.


 

Leave a Reply

Your email address will not be published. Required fields are marked *