如何防止 Mercurial 存储库从特定存储库中提取数据
我们已经制定了一个我们想要维护的存储库结构,在该结构下将阻止 RepoA 能够从 RepoB 中提取数据。如何设置一个存储库,使其只能推送到某个存储库,而不能从中拉取?
We've worked out a repository structure we'd like to maintain and under that structure will prevent RepoA from being able to pull from RepoB. How can I setup a repo so that it can only push to a certain repo but not pull from it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从技术上讲,您可以从任何位置推/拉,并且可能会尝试避免破坏这种灵活性,除非您擅长编写 钩子。而且,如果任何人对 UAT 具有写访问权限,您就无法阻止任何更改被推送到 UAT,因为当某些新位需要进入 UAT 分支进行测试时,您需要这样做。
听起来您想要做的是保持“稳定”,同时允许在从 UAT 克隆的“匿名”分支(您的 alpha)上继续工作。最终,您必须将其合并回 UAT,因此我实际上只会授予一些高级开发人员对 UAT 的写入权限,并相信他们在与分支机构合作时遵循正确的程序。
我建议查看分支指南和 管理在尝试发明一种看似保护您的新方法之前,发布Hg Book的部分分支机构。
编辑:我确实找到了类似的问题< /a> 用于防止默认推送,但允许拉取。它向您展示了实现 preoutgoing 钩子的基础知识,这不是您想要的,但本质上是相似的。
You can technically push/pull from any location and would probably try to avoid mucking with that flexibility unless you're good at writing hooks. And, if anyone has write access to UAT, you cannot prevent any changes from being pushed to UAT as you will need to do that when some new bits need to enter the UAT branch for testing.
What it sounds like you are trying to do is preserve a "stable" while allowing work to continue on an "anonymous" branch (your alpha) that was cloned from UAT. Eventually, you have to merge that back into UAT, so I would really just give a few senior-level developers write access to UAT and trust that they follow the proper procedure when working with the branches.
I suggest reviewing the Guide to Branching and the Managing Releases section of the Hg Book before trying to invent a new way to seemingly protect your branches.
Edit: I did find a similar question for preventing the default push, but allowing pulls. It shows you the basics on implementing a
preoutgoing
hook, which is not what you want, but similar in nature.