更改Git仓库共享 [英] Change GIT repository to shared
问题描述
的Git允许创建共享存储库amongs一组:
Git allows to create a shared repository amongs a group:
git --bare init --shared=group
不过 - 我怎样更改现有的资源库共享?我不想再混帐初始化它。
However - how can I change already existing repository to shared? I don't want to re-git-init it.
推荐答案
按照文档:
指定的Git仓库被几个之间用户共享。
这允许属于同一组的用户推到该储存库。
时指定,配置变量core.sharedRepository被设定成使得
在 $ GIT_DIR
文件和目录的创建要求
权限。如果没有指定,git会使用由umask的报道(2)权限。
--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
一切根据自己的喜好,和的设置 core.sharedRepository
在混帐配置相应:
Therefore, in order to change the permission, chmod
everything to your liking, and set the core.sharedRepository
in git config accordingly:
git config core.sharedRepository true
这篇关于更改Git仓库共享的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!