git - 将 GIT 存储库更改为共享

标签 git bash

Git 允许在一个组中创建共享存储库:

git --bare init --shared=group

但是 - 如何将现有的存储库更改为共享?我不想重新 git-init 它。

最佳答案

根据documentation :

--shared[=(false|true|umask|group|all|world|everybody|0xxx)]

Specify that the git repository is to be shared amongst several users. This allows users belonging to the same group to push into that repository. When specified, the config variable "core.sharedRepository" is set so that files and directories under $GIT_DIR are created with the requested permissions. When not specified, git will use permissions reported by umask(2).

因此,为了改变权限,chmod一切随心所欲,set the core.sharedRepository in git config因此:

git config core.sharedRepository true

关于git - 将 GIT 存储库更改为共享,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7268560/

相关文章:

git - 在新的 git 存储库上重播提交的最简单方法

bash - 如何在不提示用户名和密码的情况下运行 SVN 导出

macos - 使 bash 脚本显示系统事件对话框,然后获取其结果并在 if 语句中使用它

python - 使用 ssh 时 bash 中缺少 'read' 提示?

Bash、无参数警告和案例决定

git - 创建 Git 标签时自动运行 Git 钩子(Hook)

git - 带有 https 的 Jenkins Git 插件

git - pod 安装返回 fatal error : SSL certificate issue?

git - 如何将 github 个人访问 token 添加到 Visual Studio 代码

bash - 在 less 命令中查找以前的搜索