[英]Rails/Git: can't push my rails code out to the server ('~/git/myapp.git' does not appear to be a git repository)
[英]Can't push to git repository as normal user
关于这个问题有好几篇文章,但是我不确定它们是否适用于我的情况。
推送至GitHub时出错-权限不足,无法将对象添加到存储库数据库
以普通用户身份执行推送时,出现以下错误:
remote: error: insufficient permission for adding an object to
repository database ./objects
请注意,如果我以root用户身份登录本地计算机,则可以推送。 我从下面看到,来源是git@easybbb.com:root
我不知道这是否重要,但是我尝试推送到的远程存储库由我使用GitLab托管。
本地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)
它与许多类似的问题无关。 关键是“远程:错误:”。 问题是远程存储库(类似于GitHub的GitLab)。 使所有关联文件归git所有即可解决问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.