Git:将对象添加到存储库数据库的权限不足 [英] Git: insufficient permission for adding an object to repository database

查看:205
本文介绍了Git:将对象添加到存储库数据库的权限不足的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有git错误:每次创建git push origin master时都没有足够的权限来添加对象到存储库数据库。
我尝试过这里描述的解决方案:http://parizek.com/2011/05/git-insufficient-权限为添加一个对象到资料库数据库对象/ ,但它只能在下一次使用... ...
是否有一些永久的解决方案?

  $ git push origin master 
计数对象:5,完成。
使用多达2个线程的增量压缩。
压缩对象:100%(3/3),完成。
写作对象:100%(3/3),1.19 KiB,完成。
总计3(增量2),重用0(增量0)
错误:将对象添加到存储库数据库的权限不足./objects
致命:未能写入对象
错误:解压缩失败:解压缩对象异常退出
到ssh://user@git.code.sf.net/p/project/code
! [remote rejected] master - > master(n / a(unpacker error))
错误:未能将某些参考推送到'ssh://user@git.code.sf.net/p/project/code'

$ git config core.sharedRepository true

$ git push origin master
计数对象:5,完成。
使用多达2个线程的增量压缩。
压缩对象:100%(3/3),完成。
写作对象:100%(3/3),1.19 KiB,完成。
总计3(增量2),重用0(增量0)
错误:将对象添加到存储库数据库的权限不足./objects
致命:未能写入对象
错误:解压缩失败:解压缩对象异常退出
到ssh://user@git.code.sf.net/p/project/code
! [remote rejected] master - > master(n / a(unpacker error))
错误:未能将某些参考推送到'ssh://user@git.code.sf.net/p/project/code'

$ sudo chmod -R g + ws *
$ sudo chgrp -R andrey *
$ git push origin master
计数对象:5,完成。
使用多达2个线程的增量压缩。
压缩对象:100%(3/3),完成。
写作对象:100%(3/3),1.19 KiB,完成。
总计3(增量2),重用0(增量0)
远程:< Repository /git/p/project/code.git>刷新排队。
至ssh://user@git.code.sf.net/p/project/code
acd82d2..f401c90 master - > master

这是Ubuntu I:12.04.1和git:1.7.9.5

解决方案

正如错误推送到GitHub - 没有足够的权限将对象添加到存储库数据库,除了git配置设置之外,还需要:


  • 首先为您的所有回购设置 umask umask 002 (所以在你的服务器端)
  • 然后将git组设置为 rw 您的解决方案仍在服务器端。


I have git error: "insufficient permission for adding an object to repository database" every time I make "git push origin master".
I tried solution described here: http://parizek.com/2011/05/git-insufficient-permission-for-adding-an-object-to-repository-database-objects/ but it works only until next time...
Is there some permanent solution?

$ 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

This is Ubuntu I use: 12.04.1, and git: 1.7.9.5

解决方案

As mentioned in "Error pushing to GitHub - insufficient permission for adding an object to repository database", you need, in addition of the git config setting, to:

  • first set the umask for all your repos: umask 002 (so on your server side)
  • then set the git group to rw as mentioned in your solution, still on the server side.

这篇关于Git:将对象添加到存储库数据库的权限不足的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆