I\'m getting back an unusual error while trying to do a \"git push\" to my GitHub repository:
Counting objects: 8, done.
Delta compression using 2 threads.
Compre
This happened to me when I tried to git pull. Some analysis showed that somebody had commited with root in the past, thereby creating some objects with root ownership in .git/objects.
So I ran
cd
la .git/objects/
and that showed root ownership for some objects (directories) like this:
user@host:/repo> la .git/objects/
total 540
drwxr-xr-x 135 user user 4096 Jun 16 16:29 .
drwxr-xr-x 8 user user 4096 Jun 16 16:33 ..
drwxr-xr-x 2 user user 4096 Mar 1 17:28 01
drwxr-xr-x 2 user user 4096 Mar 1 17:28 02
drwxr-xr-x 2 user user 4096 Jun 16 16:27 03
drwxr-xr-x 2 user user 4096 Mar 3 13:22 04
drwxr-xr-x 2 root root 4096 Jun 16 16:29 05
drwxr-xr-x 2 user user 4096 Jun 16 16:28 07
drwxr-xr-x 2 root root 4096 Jun 16 16:29 08
Then I ran
sudo chown -R user:user .git/objects/
and it worked!
I was replacing user with my real user, of course.