Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git commit fails due to insufficient permissions

Tags:

git

I am getting the following error while trying to commit to a local repository:

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

I created another repository to compare the permissions of .git and .git/objects and everything works fine in the new repository, and the permissions are the same drwxr-xr-x.

What might be causing this error?

like image 898
dmz73 Avatar asked Jul 13 '10 16:07

dmz73


1 Answers

cd <path-to-repo>
cd .git/objects
sudo chown -R <username>:<group> *

This worked for me with group staff.

like image 99
Sebastián Lozada Avatar answered Sep 28 '22 05:09

Sebastián Lozada