Insufficient permission for adding an object Git error

I updated Meteor to its latest version and I then tried to pull down stuff from my repo and I received this error:

error: insufficient permission for adding an object to repository database .git/objects
fatal: git-write-tree: error building trees
Cannot save the current index state

I had no idea what was happening and after 30 minutes online, here is the solution.

Go to your project root. If you type:

$ ls -la
you should see .git
Then you need to:
$ cd .git/objects
$ ls -al
$ sudo chown -R yourname:yourgroup *

You can tell what yourname and yourgroup should be by looking at the permissions on the majority of the output from that ls -al command

Note: don’t forget the asterisk at the end of the sudo line!

git permissions solution source article that provided the best answer to this problem.

Leave a Reply

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