当我尝试推到共享git远程时,我得到以下错误: 向存储库数据库添加对象权限不足

这适用于下一次推送,因为所有的文件都属于正确的组,但下一次有人推送一个更改时,它会在对象文件夹中创建一个新项目,该项目的默认组为组。我唯一能想到的就是改变所有开发人员签入项目的默认组,但这似乎是一种hack。什么好主意吗?谢谢。


当前回答

我遇到了同样的问题。阅读这里,我意识到这是文件权限的消息是指。对我来说,解决办法是:

/etc/inetd.d/git-gpv

它以“nobody”用户启动git-daemon,因此缺乏写权限。

# Who   When    What
# GPV   20Nov13 Created this by hand while reading: http://linuxclues.blogspot.co.uk/2013/06>/git-daemon-ssh-create-repository-debian.html
# GPV   20Nov13 Changed owner (to user_git) otherise nobody lack permission to update the repository
#git stream tcp nowait nobody  /usr/bin/git git daemon --inetd --verbose --enable=receive-pack --export-all /gitrepo
git stream tcp nowait user_git  /usr/bin/git git daemon --inetd --verbose --enable=receive-pack --export-all /gitrepo

(我怀疑其他人把他们的inetd conf文件称为git-gpv。通常它会直接在/etc/inetd.conf中)

其他回答

最简单的解决方案是:

来自项目总监:

sudo chmod 777 -R .git/objects

我遇到了同样的问题。阅读这里,我意识到这是文件权限的消息是指。对我来说,解决办法是:

/etc/inetd.d/git-gpv

它以“nobody”用户启动git-daemon,因此缺乏写权限。

# Who   When    What
# GPV   20Nov13 Created this by hand while reading: http://linuxclues.blogspot.co.uk/2013/06>/git-daemon-ssh-create-repository-debian.html
# GPV   20Nov13 Changed owner (to user_git) otherise nobody lack permission to update the repository
#git stream tcp nowait nobody  /usr/bin/git git daemon --inetd --verbose --enable=receive-pack --export-all /gitrepo
git stream tcp nowait user_git  /usr/bin/git git daemon --inetd --verbose --enable=receive-pack --export-all /gitrepo

(我怀疑其他人把他们的inetd conf文件称为git-gpv。通常它会直接在/etc/inetd.conf中)

只需复制并粘贴到您自己的终端。

sudo chown -R "${USER:-$(id -un)}" .

您需要在您的终端上复制并粘贴此命令:-

sudo chmod 777 -R .git/objects

我在使用Vagrant运行远程开发开发机器时得到了这个错误。上述解决方案都不能工作,因为所有文件都具有正确的权限。

我把config.vm.box = "hasicorp/ bioniic64 "改为config.vm.box = "bento/ubuntu-20.10"。