更改Git仓库共享 [英] Change GIT repository to shared

查看:757
本文介绍了更改Git仓库共享的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

的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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆