在git上的每个目录权限

编程入门 行业动态 更新时间:2024-10-27 04:37:36
本文介绍了在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上的每个目录权限

本文发布于:2023-10-23 06:18:14,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1520041.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:权限   目录   git

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!