Question:
I’m getting back an unusual error while trying to do a “git push” to my GitHub repository:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
Counting objects: 8, done. Delta compression using 2 threads. Compressing objects: 100% (4/4), done. Writing objects: 100% (5/5), 1.37 KiB, 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-objects exited with error code 128 error: unpack failed: unpack-objects abnormal exit To git@github.com:bixo/bixo.git ! [remote rejected] master -> master (n/a (unpacker error)) error: failed to push some refs to 'git@github.com:bixo/bixo.git' |
- After a clean clone from GitHub, I can edit/add/commit/push a modified file.
- If I then repeat this a second time I get the above error.
- I can push to other GitHub repositories just fine.
- I’ve checked file/directory permissions on my side, and they seem OK.
- I’m running git 1.6.2.3 on Mac OS X 10.5.8
The above repository was the source of my fun for a previous Stack Overflow question (SO 1904860), so maybe the GitHub repo got corrupted. The only similar issue I’ve found via searching was an unpack failed problem reported on github. Has anybody else run into this issue before, especially when not using GitHub?
Answer:
When you see this error outside of github, here’s a remedy.
Got this from:
http://mapopa.blogspot.com/2009/10/git-insufficient-permission-for-adding.html
1 2 3 4 5 6 7 8 |
ssh me@myserver cd repository/.git sudo chmod -R g+ws * sudo chgrp -R mygroup * git config core.sharedRepository true |
After this the git daemon should use the group file permissions when writing to .git/objects.