我有一个现有的 git 存储库(一个空的),到目前为止只有我可以写入。我想向某个 UNIX 用户组 foo 开放它,以便 foo 的所有成员都可以向它推送。我知道我可以轻松地设置一个新的 git 存储库:
git init --bare --shared=group repodir
chgrp -R foo repodir
但我需要对现有 repo 目录进行等效操作。
最佳答案
试试这个让 repodir
中的现有存储库为组 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 - 如何配置现有的 git repo 以供 UNIX 组共享,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3242282/