git 上的每个目录权限 [英] Per-directory permissions on git

查看:55
本文介绍了git 上的每个目录权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在考虑将我们的 VCS 切换到 git 或 subversion.我更喜欢切换到 git,但是 subversion 有一个我在 git 中没有看到的不错的功能:每个目录访问控制.

We are considering switching our VCS to either git or subversion. I'd prefer switching to git, but subversion has a nice feature that I don't see in git : per directory access control.

我们目前在 cvs 中有 project1、project2 存储库,具有不同的权限.我们想要一个单一的存储库,有两个目录 project1 &project2 具有不同的权限.git 和 svn 一样可行吗?

We currently have project1, project2 repositories in cvs, with different permissions. We'd like to have one single repository, with two directories project1 & project2 with different permissions. Is it doable with git as it is with svn ?

我知道子模块可能可以实现这一点,但我们的目标是能够在 project1 & 中进行更改后进行一次提交.项目2.

I'm aware of submodules, which could probably achieve that, but the goal for us is to be able to do one single commit with changes in project1 & project2.

我们主要是IP问题,想确定有些人无法读取(不仅仅是推送)某些目录.那么,是 git 来迎接挑战还是我必须使用 git-svn ?

We mainly have IP issues, and want to be sure that some people can't read (not just push) some directories. So, is git up for the challenge or will I have to use git-svn ?

谢谢

推荐答案

使用由 gitolite.
查看其功能.

如果你将它与子模块(你知道的)结合起来,你将只管理每个仓库或每个分支的访问,并且仍然提交 project1 和 project2(在子仓库的情况下有两次提交:见 这个问题)

If you combine that with submodules (which you are aware of), you would only manage per-repo or per branch access and still commit both project1 and project2 (with two commits in case of a subrepo: see this question)

如果您坚持使用一个存储库(即使您必须使用一组可以随其生命周期发展的数据,这应该使它们成为模块的理想候选者),那么 gitolite 功能确实包括:

If you insist on working with one repo (even though you have to set of data which could evolve with their own lifecycle, which should make them good candidates for modules), then the gitolite features do include:

基于文件/目录名称的限制

除了基于分支名称的限制之外,gitolite 还允许您限制哪些文件或目录可以参与推送的更改

In addition to branch-name based restrictions, gitolite also allows you to restrict what files or directories can be involved in changes being pushed

dpk 在评论中提到最后一个功能(文件/目录名称限制)在 conf/example.conf Gitolite 文件.

dpk mentions in the comments that this last feature (the file/dir name restriction) is detailed in the conf/example.conf file of Gitolite.

这篇关于git 上的每个目录权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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