git - 如何配置现有的 git repo 以供 UNIX 组共享

标签 git permissions share shared

我有一个现有的 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/

相关文章:

git - TortoiseGit 取消整个文件夹的版本

c++ - 这些辅助文件应该在 Git 版本控制之下吗?

ruby - rvm 组无法写入目录

permissions - 权限被拒绝(公钥、键盘交互)

PHP 5.5 rename() 修改文件并删除权限 - 为什么?

android - 通过热点获取连接设备的名称

git - 保存 github 用户名以更新子模块 azure pipeline

git - "git rev-list origin..HEAD"应该返回什么?

Android Studio : Facebook show.(内容)不工作

ios - iOS 中的 Facebook 分享对话框