如何使用Git设置特定的路径权限? [英] How to set specific path permissions using Git?

查看:153
本文介绍了如何使用Git设置特定的路径权限?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Git控制版本系统。我想为特定文件夹设置自定义权限。例如,user1可以提交/读取dir1,user2只能读取dir1,而其他人根本无法读取。这是可能的和如何? GitHub是否支持它?

I'm using Git control version system. I want to set custom permission for a specific folder. For example, user1 can commit/read dir1, user2 can only read dir1 and others cannot read it at all. Is that possible and how? Does GitHub support it?

推荐答案

Git的设计不允许这种访问控制。您可以为dir1和dir2创建单独的回购站,并为每个回购站提供适当的权限,但您无法限制访问Git回购站内的单个目录。

The design of Git does not allow this kind of access-control. You can create separate repos for dir1 and dir2, and give appropriate permissions for each of those repos, but you can't restrict access to single directories inside a Git repo.

这篇关于如何使用Git设置特定的路径权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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