gpt4 book ai didi

Git:将对象添加到存储库数据库的权限不足

转载 作者:太空狗 更新时间:2023-10-29 12:54:51 29 4
gpt4 key购买 nike

每次我执行“git push origin master”时,我都会遇到 git 错误:“没有足够的权限将对象添加到存储库数据库”。
我尝试了此处描述的解决方案:http://parizek.com/2011/05/git-insufficient-permission-for-adding-an-object-to-repository-database-objects/但它只能工作到下一次...
有什么永久性的解决方案吗?

$ git push origin master
Counting objects: 5, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 1.19 KiB, done.
Total 3 (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
To ssh://user@git.code.sf.net/p/project/code
! [remote rejected] master -> master (n/a (unpacker error))
error: failed to push some refs to 'ssh://user@git.code.sf.net/p/project/code'

$ git config core.sharedRepository true

$ git push origin master
Counting objects: 5, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 1.19 KiB, done.
Total 3 (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
To ssh://user@git.code.sf.net/p/project/code
! [remote rejected] master -> master (n/a (unpacker error))
error: failed to push some refs to 'ssh://user@git.code.sf.net/p/project/code'

$ sudo chmod -R g+ws *
$ sudo chgrp -R andrey *
$ git push origin master
Counting objects: 5, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 1.19 KiB, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: <Repository /git/p/project/code.git> refresh queued.
To ssh://user@git.code.sf.net/p/project/code
acd82d2..f401c90 master -> master

这是我使用的 Ubuntu:12.04.1,和 git:1.7.9.5

最佳答案

如“Error pushing to GitHub - insufficient permission for adding an object to repository database”中所述,除了 git 配置设置之外,您还需要:

  • 首先为您的所有存储库设置umask:umask 002(在您的服务器端)
  • 然后将 git 组设置为 rw,如您的解决方案中所述,仍在服务器端。

关于Git:将对象添加到存储库数据库的权限不足,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12770410/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com