SVN忽略项目中任何位置的文件
所以我开始使用 Subversion,并对忽略文件感到困惑。
根据我的阅读,我可以使用 propedit/propset 忽略目录中的文件。然而,我添加了一条规则来忽略以点开头的文件(VIM 的交换文件有时会留下),但看起来我必须将该规则应用于项目中的每个目录和子目录。
有谁知道如何使用 SVN 使文件模式忽略语句递归工作?
这是我的超级简单的忽略(我假设 SVN 使用 GLOB 而不是 RE):
.*
我的项目是这样的:
project/ application/ models/ views/ form1/ form2/ config/ controllers/ libraries/ plugins/ helpers/ css/
应用程序下的许多文件夹都有几层深。必须将此规则应用于每个文件夹将是一个极大的烦恼,特别是因为它正在积极开发并且可能会发生变化。
另外,我应该补充一点,我对修改 ~/.subversion/ 中的用户 subversion 配置不感兴趣,因为我希望此忽略存在于存储库中,并影响所有开发人员,而不仅仅是我。
so I have started using Subversion and am confused about the ignore files.
From what I've read, I can ignore files within a directory with propedit/propset. However, I added a rule to ignore files starting with a dot (swap files for VIM which sometimes get left over), but it would seem then that I would have to apply that rule to every single directory and subdirectory in the project.
Does anyone know a way to make a file-pattern ignore statement work recursively using SVN?
here's my super-simple ignore (I'm assuming SVN uses GLOB and not RE):
.*
and my project is something like:
project/ application/ models/ views/ form1/ form2/ config/ controllers/ libraries/ plugins/ helpers/ css/
and many of the folders under application are several levels deep. It would be a supreme annoyance to have to apply this rule to each and every folder, especially since this is under active development and subject to change.
ALSO, i should add that I am NOT interested in modifying my user subversion config in ~/.subversion/ because I want this ignore to live in the repository, and affect all developers, not just me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该能够从项目的根目录使用 svn propset --recursive svn:ignore .* 。
You should be able to use
svn propset --recursive svn:ignore .*
from the root of your project.我相信 propset --recursive 选项实际上递归地设置属性,但不会永久/全局忽略文件。您可以通过更新 .subversion/config 文件来全局忽略,这将忽略所有地方的模式,无论文件位于何处以及单个文件/文件夹上的 svn props。
请参阅此 stackoverflow 讨论:svn 中是否有全局忽略的概念?
I believe the propset --recursive option actually sets the properties recursively, but does not permanently/globally ignore the files. You can globally ignore by updating your .subversion/config file, and this will ignore the pattern everywhere regardless of where the files are located and svn props on individual files/folders.
See this stackoverflow discussion: Is there a concept of global ignores in svn?