gitolite:允许仅更改选定的文件
如何配置 git 和 gitolite 以允许特定用户仅更改特定目录内的文件?
例如,原始主分支中的文件:
/dir1/
/dir2/file1
/dir2/file2
/dir3/file1
用户kathrine
,仅允许更改/dir2/file1
和/dir2/file2
$kathrine: git clone [email protected]:test.git
结果:
/dir2/file1
/dir2/file2
是否有任何gitolite.conf 中的 per-dir 指令还是我应该为该用户配置 git 使用新分支?
我只是不希望图形设计师能够访问源代码文件。
How to configure git and gitolite to allow specific user to change just files that are inside specific directory?
e.g. files in origin master branch:
/dir1/
/dir2/file1
/dir2/file2
/dir3/file1
User kathrine
, allow to change only /dir2/file1
and /dir2/file2
$kathrine: git clone [email protected]:test.git
results in:
/dir2/file1
/dir2/file2
Are there any per-dir directives in gitolite.conf
or shall I configure git with new branch for this user?
I just don't want graphics designer to have access to the source code files.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
2010:对于 Gitolite 2(对于 gitolite 3 可能已更改)
否(意味着需要创建具有正确内容的专用分支)。
正如gitolite 的作者本人所说的:
[嗯稀疏结帐可能会有所帮助,但无论如何都不容易)
请参阅“安全、访问控制部分,和审核”,这里是写访问的示例:
conf/example.conf
文件 包含所有详细语法:话虽如此,正如OP所说,棘手的问题仍然存在:
一般原则:
在这些文件不存在的历史时刻创建“graph_designer”分支。
从那里,有两个选择:
git rebase --interactive
),以便第一个只有dir2
文件(然后提交影响任何其他目录)这意味着,这些文件没有过去的历史记录,但它们可能从一开始就不需要该历史记录。
该“
graph_designer
”将是唯一允许克隆的分支,并且不会包含任何未经授权文件的历史记录。2010: For Gitolite 2 (might have changed for gitolite 3)
No (meaning a dedicated branch with the right content needs to be created).
As the author of gitolite himself put it:
[well sparse checkout might help, but it is not easy anyway)
See the section "security, access control, and auditing", and here is an example of write access:
The
conf/example.conf
file has all the detailed syntax:That being said, the tough question remains, as the OP puts it:
General principle:
create 'graph_designer' branch at a point in history where those files weren't present.
From there, two choices:
git rebase --interactive
) in order to have first the one with onlydir2
files (and then commits impacting any other directory)That means, no past history for those files, but they might not need that history right from the beginning.
That '
graph_designer
' will be the only branch allowed to be cloned, and won't contain any history with non-authorized files.