如何将现有的 git 存储库配置为由 UNIX 组共享 [英] How to configure an existing git repo to be shared by a UNIX group
本文介绍了如何将现有的 git 存储库配置为由 UNIX 组共享的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个现有的 git repo(一个裸的),到目前为止只有我可以写.我想将它开放给某个 UNIX 用户组 foo,以便 foo 的所有成员都可以推送到它.我知道我可以轻松地设置一个 new git repo:
I have an existing git repo (a bare one) which has up to this point only been writable by me. I want to open it up to some UNIX user group, foo, so that all members of foo can push to it. I'm aware that I can easily set up a new git repo with:
git init --bare --shared=group repodir
chgrp -R foo repodir
但我需要对 现有 存储库目录进行等效操作.
But I need the equivalent operation for an existing repo dir.
推荐答案
尝试使 repodir
中的现有存储库为 foo
组中的用户工作:
Try this to make an existing repository in repodir
work for users in group foo
:
chgrp -R foo repodir # set the group
chmod -R g+rw repodir # allow the group to read/write
chmod g+s `find repodir -type d` # new files get group id of directory
git init --bare --shared=all repodir # sets some important variables in repodir/config ("core.sharedRepository=2" and "receive.denyNonFastforwards=true")
这篇关于如何将现有的 git 存储库配置为由 UNIX 组共享的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文