Error when performing a push on a git project: error: insufficient permission…

Tiempo de lectura: < 1 minuto

Reading time: < 1 minute

When trying to perform a push on a project that is configured with git, I get the following error:

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

To solve this error, I first navigated to the .git directory.

Inside this directory, we executed the command ls -lai.

ls -lai

Among other data, we observed “objects” inside.

Next, we modified the permissions for objects using the following command:

sudo chmod -R 777 objects

Therefore, “objects” now has the necessary permissions for us to perform a push.

I hope this helps! Have a great day.

Leave a Comment