将 SVN 存储库的部分内容复制到另一个存储库
是否有任何工具(或者 svnsync 可以做到这一点,我不认为它可以)可以将特定文件或目录从一个存储库复制到另一个存储库(都是远程的)?
我想为代码库提供只读存储库,但只是该库的一个子集,而不是整个库。
谢谢。
Is there any tool (or can svnsync do this, I don't think it can) that can copy a specific file or directory from one repo to another (both remote)?
I want to provide a read-only repo for a code library, but only a subset of that library, not the whole thing.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您不介意亲自动手,您可以编写一个小脚本来导出私有项目的文件并将 svn-clean-files 提交到您的公共项目。
这样,即使公共项目上的 svn 差异也可能与原始 svn 历史不同。但这很好,因为它不是有意的。
像这样的 cron 作业?
If you don't mind getting your hands dirty, you could write a little script that exports the file(s) of the private project and commits the svn-clean-files to your public project.
This way even svn diffs on the public project are possibly albeit that's not the same as the original svn history. But thats good as it's not intended.
Something like this as cron job?
我建议您使用 外部定义 作为解决方案。为代码库的只读子集创建新存储库并将其映射到项目的子文件夹。
I suggest you to use externals definitions as a solution. Create new repository for a read-only subset of your code library and map it to a project's subfolder.
虽然 @initall 的解决方案是可行的,但您会丢失历史信息等。我建议您按照您的建议使用 svnsync 。
由于 1.5 svnsync 能够仅同步源存储库的子树,因此我认为这是一个更干净的解决方案,您将能够对每个存储库拥有不同的访问权限。请参阅存储库复制 svn 手册中的部分了解详细信息。
While @initall's solution is viable, you'd loose history info etc. I'd advocate using svnsync as you suggested yourself.
Since 1.5 svnsync is capable of syncing just a sub tree of the source repo, therefore I'd say it's a cleaner solution and you would be able to have different access rights on each repo. See the repository replication section in the svn manual for details.