Typical github steps moving in a new repository

Global setup:
Set up git
git config --global user.name "Dave Parizek"
git config --global user.email dude@wherever.com

Next steps:
mkdir UAC
cd UAC
git init
touch README
git add README
git commit -m 'first commit'
git remote add origin git@github.com:BioComputing/UAC.git
git push -u origin master

Existing Git Repo?
cd existing_git_repo
git remote add origin git@github.com:BioComputing/UAC.git
git push -u origin master

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

strangely, I had been pushing to this repository for weeks no problems. Then one day I get the error message for the title above:


$git push
Counting objects: 9, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 506 bytes, done.
Total 5 (delta 2), reused 0 (delta 0)
error: insufficient permission for adding an object to repository database ./objects
fatal: failed to write object
error: unpack failed: unpack-objects abnormal exit

I was a member of the group in question, checked via:

$ groups myusername

and verified that group had write permissions:

$ ls -la

Turned out a few files had shown up in the object directory with different permissions.

To fix:

ssh to server
cd your-repository.git

sudo chmod -R g+ws *
sudo chgrp -R yourgroup *

and maybe:

git repo-config core.sharedRepository true

and then try to push again

%d bloggers like this: