在这个问题上有几个很好的post,但我不确定他们是否适用于我的情况。
推送到GitHub时出错 – 没有足够的权限将对象添加到存储库数据库
Git推送错误:没有足够的权限将对象添加到存储库数据库
以普通用户身份执行推送时,收到以下错误:
remote: error: insufficient permission for adding an object to repository database ./objects
请注意,如果我以root身份login本地计算机,我可以推送。 我从下面看到,起源是git@easybbb.com:root
我不知道它是否重要,但我试图推送到的远程存储库由我使用GitLab托pipe。
本地git目录是0775,属于“www”组,我已经执行了chmod -R g+rwxs /var/www/
以确保新文件是组“www”,正在尝试推送的普通用户属于组“www”,我已经执行了git config core.sharedRepository group
。
我该如何解决这个错误?
git push origin master Counting objects: 11, done. Delta compression using up to 4 threads. Compressing objects: 100% (6/6), done. Writing objects: 100% (6/6), 487 bytes | 0 bytes/s, done. Total 6 (delta 5), reused 0 (delta 0) remote: error: insufficient permission for adding an object to repository database ./objects remote: fatal: failed to write object error: unpack failed: unpack-objects abnormal exit To git@easybbb.com:root/bidjunction.git ! [remote rejected] master -> master (unpacker error) error: failed to push some refs to 'git@easybbb.com:root/bidjunction.git' git remote -v origin git@easybbb.com:root/bidjunction.git (fetch) origin git@easybbb.com:root/bidjunction.git (push)
对于许多类似的问题,它没有任何关系。 关键是“远程:错误:”。 问题是远程仓库(GitLab,它类似于GitHub)。 让所有由git拥有的相关文件解决了这个问题。