是否可以使用 subversion 将单个文件提交到共享同一父目录的多个目录
我想知道如何使用 subversion 工具一次性将文件/文件夹提交到多个文件夹。 我可以将文件放置在多个文件夹中,然后进行提交,但我只想将其放置在单个文件夹中,并且它应该在所需的文件夹中创建副本。是否可以?
I would like to know as how to commit a file/folder to multiple folders in one go using subversion tool.
I can place the file in multiple folders and then do commit, but i just want to place it is a single folder and it should create copies in the required folders. Is it possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
不,Subversion 仅支持一个主存储库。但您可以从许多位置进行更新。提交一个地方,从其他地方(例如 Web 服务器目录)更新。如果您在那里进行更改,您也可以从那里提交。
No, subversion supports only one main repository. But you can update from many locations. Commit one place, update from other places like web server directory. If you make change there you can also commit from there.
Apache Ant 或 Maven 等工具将帮助您完成此任务。
编辑:也许在预提交挂钩中是这样的(在存储库/挂钩目录中创建文件“预提交”)(草稿版本):
Something like Apache Ant or Maven will help you accomplish this task.
Edit: maybe something like this in a pre-commit hook (create a file 'pre-commit' in your repository/hooks dir)(draft version):
如果您尝试重用中心文件,可以使用
svn:externals
属性。将文件提交到存储库树中的某个中心位置,然后为该文件创建 svn:externals 属性(或者最好是其父目录)。这样你就可以从任何地方提交它(还有 svn:externals 拉入它的位置),并重用它。If you're trying to reuse a central file, you can use the
svn:externals
property. Commit the file to some central place in your repository tree, and then create an svn:externals property to the file (or maybe better its parent directory). That way you can commit it from everywhere (also the locations where its being pulled in by svn:externals), and reuse it.