具有不同文件权限的git克隆
在我们的服务器上,三个(实际上:数千个)文本文件存储在裸 git 存储库中:A.txt、B.txt、C.txt。
- 用户“admin”应该查看/编辑它们。
- 用户“Foo”应该查看/编辑“A.txt”和“B.txt”,但不允许他查看“C.txt”的内容。
- 仅允许用户“guest”查看/编辑“A.txt”。
所有三个用户都应该能够使用他们的文件克隆 git 存储库 被允许编辑。
有没有可能用 git (...或 Mercurial)来做到这一点?
想法:我可以使用稀疏结帐来克隆裸 git 存储库吗 git 为用户“Foo”和“guest”提供的功能,仅包含他们的文件 被允许看吗?
还有其他(更快)的想法吗?
On our server are three (in reality: thousands of) text files stored in a bare git repository: A.txt, B.txt, C.txt.
- User "admin" should view/edit them all.
- User "Foo" should view/edit "A.txt" and "B.txt" but he is not allowed to see the content of "C.txt".
- User "guest" should only be allowed to view/edit "A.txt".
All three users should be able to clone the git repository with the files they
are allowed to edit.
Is there any possibility to make this with git (...or mercurial)?
Idea: Can I make two clones of the bare git repository with the sparse checkout
feature of git for the user "Foo" and "guest" wich include only the files they
are allowed to see?
Any other (faster) idea?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你应该:
A.txt
文件)这意味着频繁合并以更新不同的分支并传播不同的修改。
另外,使用 gitolite,您可以控制谁可以拉/推什么(在分支级别),这意味着:
guest
分支。guest
分支和users
分支,同时能够推送users
分支(或两个分支)如果您希望用户更新guest
分支的内容)。You should:
A.txt
files)That means frequent merges to update the different branches and propagate the different modification.
Plus, with gitolite, you can control who can pull/push what (at a branch level), which means:
guest
branch.guest
branch and theusers
branch, while being able to push theusers
branch (or both branches if you want a user to update the content ofguest
branch).