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

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

问题描述

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



我们目前有project1,project2存储库在CVS中,具有不同的权限。
我们希望有一个存储库,其中有两个目录project1& project2具有不同的权限。 git是否可以像svn一样使用它?



我知道子模块,这可能可以实现,但我们的目标是能够做到一个单一的提交项目1& project2。

我们主要有IP问题,并且要确保有些人不能读取(而不是推送)一些目录。
所以,是git的挑战,或者我会不得不使用git-svn?
$ b $ p感谢

解决方案

这是可行的与访问(推/拉)由 gitolite

查看其功能

如果将它与子模块(您知道的)组合在一起,那么您将只管理每个回购或每个分支的访问权限,并仍提交project1和project2(在subrepo的情况下有两个提交:请参阅 $ b


file / dir基于NAME的限制

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

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


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.

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 ?

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.

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 ?

Thanks

解决方案

It is doable with a central repo with access (push/pull) managed by gitolite.
See its features.

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)

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:

file/dir NAME based restrictions

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 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天全站免登陆