忽略递归,包括动态生成的文件和目录
正如标题所解释的 - 是否可以递归地在目录上设置忽略属性,包括动态生成的文件和目录。
例如,我有一个 tmp 文件夹,它会不断添加和删除许多其他文件和文件夹。
Just as the title explains - is it possible to set an ignore property on a directory recursively, including dynamically generated files and directories.
For example, I have a tmp folder which will constantly get a lot of other files and folders added to and removed from.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
如果 tmp 中没有版本控制文件,那么我会 svn:ignore 顶层目录。否则,您必须找到与生成的文件而不是版本控制的文件匹配的模式(例如,强制生成的文件命名为 generated-FOO.bar 并 svn:ignore 该模式)。
If there are no versioned files in tmp then I would svn:ignore that directory at the top level. Otherwise you'll have to find a pattern that matches the generated files and not the versioned files (e.g. force generated files to be named generated-FOO.bar and svn:ignore that pattern).
Which
尽管最好避免必须执行递归操作(通过忽略整个生成的目录),但如果您想强制文件系统分支递归地忽略项目,请使用
附带的警告,您将覆盖忽略的模式可能会在下面设置新的一组被忽略的模式。
Look into
While it is best to avoid having to do recursive things (by ignoring entire generated directories), if you want to force a file system branch to ignore items recurisvely, then use
Which comes with the caveat that you will override the ignored patterns that might be set below with your new set of ignored patterns.
你可能想在 svn 配置文件中设置全局忽略规则:
但是,你应该记住,它将为新创建的工作目录激活,这可能会忽略你不想要的内容(使用一些罕见和特定的名称)并且不会被存储在 SVN 存储库中(作为属性)。
You may want to setup global ignore rule in svn config file:
But, you should remember that it will be activated for newly created working dirs, this possibly will ignore what you were not intended (use some rare and specific name) and will not be stored in SVN repo (as property).
根据您的上下文,您还可以查看 ~/.subversion/config 中的“global-ignores”配置字段。它是基于每个用户定义的,而不是存储为存储库的一部分。
http://borkware.com/quickies/single?id=260
Depending on your context, you might also look into the "global-ignores" configuration field in ~/.subversion/config. It's defined on a per-user basis, not stored as part of the repository.
http://borkware.com/quickies/single?id=260