Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ssh/git shell上的git文件权限?_Git_Ssh - Fatal编程技术网

ssh/git shell上的git文件权限?

ssh/git shell上的git文件权限?,git,ssh,Git,Ssh,我在服务器上为开发人员设置了一个私有的裸git存储库foo.git,并通过登录shellgit shell让他们通过ssh访问 由于这是一个多用户系统,我为他们设置的裸存储库在其上运行了chmod-ro-rwx foo.git,因此同一系统上的其他用户无法访问此存储库 问题在于,当开发人员推送更改时,在git存储库中创建的新文件(例如新对象或新分支标记)是世界可读的 我如何告诉git、ssh、git shell或其他什么东西——当它在foo.git中创建文件时,它们应该是chmodo-rwx?请

我在服务器上为开发人员设置了一个私有的裸git存储库
foo.git
,并通过登录shell
git shell
让他们通过ssh访问

由于这是一个多用户系统,我为他们设置的裸存储库在其上运行了
chmod-ro-rwx foo.git
,因此同一系统上的其他用户无法访问此存储库

问题在于,当开发人员推送更改时,在git存储库中创建的新文件(例如新对象或新分支标记)是世界可读的

我如何告诉git、ssh、git shell或其他什么东西——当它在foo.git中创建文件时,它们应该是chmod
o-rwx

请参见
git config--help
并搜索
core.sharedepository

如果我对您的配置理解正确,您必须将其放入
config
-文件中:

[core]
    sharedRepository = 0666

如果我对您的配置理解正确,您必须将其放入
config
-文件中:

[core]
    sharedRepository = 0666
.

为什么不使用(类似)Gitolite来管理对存储库的访问

它使您能够很好地控制对存储库的访问(如果需要,甚至可以单独控制分支),并且对所有git用户只使用一个Unix用户帐户(通常称为“git”)。(这与github.com的工作原理类似。)

为什么不使用(类似)Gitolite来管理对存储库的访问


它使您能够很好地控制对存储库的访问(如果需要,甚至可以单独控制分支),并且对所有git用户只使用一个Unix用户帐户(通常称为“git”)。(这与github.com的工作原理类似。)

这是我一直在寻找的东西(但实际上我想要
sharedepository=0640
)。谢谢。这是我一直在找的东西(但实际上我想要
sharedepository=0640
)。谢谢。是的,我们,但这似乎有点过分了,因为我们可能想添加其他服务,所以我们希望每个人都有自己的unix帐户。是的,我们,但这似乎有点过分了,因为我们可能想添加其他服务,所以我们希望每个人都有自己的unix帐户。