git对存储库文件或路径的访问权限 [英] git access permissions to repository files or paths

查看:99
本文介绍了git对存储库文件或路径的访问权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何防止某些用户修改存储库中的某些路径或文件?实际上,正如我所看到的,这是由存储库服务器控制的(通过挂钩?),但是一些本地客户端策略控制也会很好,这是提前警告用户的一种方法。

据我所知,用户/角色管理不是git的一部分,但我确信有人用来做这种控制的工具和脚本。不幸的是我几乎找不到关于这个问题的任何信息。

解决方案

您也可以在客户端使用钩子来执行检查(即在本地克隆上的git / hooks中)。它可以是预先提交的钩子 - https:// git -scm.com/book/en/v2/Customizing-Git-Git-Hooks



您也可以考虑使用 Gitolite 出于此目的。


How would one prevent certain users from modifying certain paths or files in a repository? Actually, as I see it, this is something that would be controlled by the repository server (through hooks?) but also some local client policy control would be nice, as a way to warn users beforehand.

I understand that user/role management is not part of git, but I'm sure there are tools and scripts out there that people are using to do this kind of control. Unfortunately I can't find almost any information on the subject.

解决方案

You can have hooks on client side as well to do the check ( ie in the git/hooks on the local clone. It can be a pre-commit hook - https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks)

You can also consider using Gitolite for such purposes.

这篇关于git对存储库文件或路径的访问权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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