svn - 如何处理被覆盖的目录
我只是想知道是否有一种解决方法可以将文件/目录添加到 svn 目录中,这些文件/目录会被完全覆盖,而不会破坏 svn 结构并且必须再次导出或从新开始。
你一定在想,如果它们被完全重写,为什么它们首先需要放在 svn 中?这么说吧,我希望一切都安全。
任何帮助表示赞赏。
谢谢 安德烈亚斯
I was just wondering if there's a workaround for adding files/directories to your svn directories which get overwritten completely without ruining the svn structure and having to export or start from new again.
You must be thinking, if they are overwrritten completely, why do they need to be in svn in the first place? Let's just say I want everything to be safe.
Any help is appreciated.
Thanks
Andreas
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
简短回答:构建过程创建或重新创建的文件和目录不属于存储库。
如果您选择忽略这个最佳实践(无论出于什么原因),我建议您编写一个 shell 脚本或一个小工具,它会递归地删除目录树中的每个文件,但保持文件夹结构完整并省略
.svn
文件夹。无论您现在要删除完整的文件夹,都可以在构建过程中调用此工具。附录:这是一篇以前的SO帖子,处理版本控制生成的代码的主题,恕我直言,这几乎是同样的问题:
Subversion - 处理代码生成
Short answer: files and directories created or recreated by the build process don't belong into the repository.
If you choose to ignore this best practice (for what reason ever), I would suggest that you write a shell script or a small tool which deletes every file recursively in a directory tree, but keeps the folder structure intact and omits the
.svn
folders. Call this tool in your build process whereever you now are deleting complete folders.Addendum: here is a former SO post, dealing with the topic of versioning generated code, which IMHO is almost the same problem:
Subversion - dealing with code generation
我想我们正在做你所要求的。
我们的项目具有以下布局:
构建目录是 svn:ignore'd,我们只提交重建二进制文件所需的源。我们的构建工具会在构建过程中自动创建缺少的输出目录。
I think we are doing what you are asking.
We have projects with the following layout:
The build directories are svn:ignore'd and we only commit the sources required to rebuild the binaries. Our build tool auto-creates the missing output directories during the build.
“完全覆盖”到底是什么意思?这些目录真的被删除了吗?或者只是它们的内容被覆盖?
多年来我们一直在成功地使用类似的方法;每天晚上,作业都会从我们的开发数据库中转储元数据脚本,添加所有新文件并执行 svn 提交。
但这要求目录结构保持完整(特别是 .svn 子目录)。
亲切的问候,弗兰克
What exactly do you mean by "overwritten completely"? Are the directories actually deleted? Or are just their contents overwritten?
We've been using a similar approach successfully for years; every night, a job dumps the metadata scripts from our development databases, adds all new files and does a svn commit.
But this requires that the directory structure remains intact (esp. the .svn subdirectories).
Kind regards, Frank