svn:ignore - 它是如何工作的?

标签 svn svnignore

我很难理解 svn:ignore 属性。如果有人能在这方面帮助我,那就太好了。

我从 svn 存储库中查看了一个 grails Web 应用程序,该存储库已将 svn:ignore 属性应用于 *.log 文件和/target 文件夹。显然,当我检查 *.log 文件时,/target 文件夹丢失了。在我的本地工作副本上处理此 grails 应用程序后,将创建/target 目录和 *.log 文件。现在,当我将更改提交到 svn 存储库时,/target 文件和 *.log 文件也会提交吗?或者它们会因为 grails 应用程序的 svn 副本上已经存在 svn:ignore 属性而被自动忽略吗?

希望我已经说清楚了。

感谢您提供的任何帮助。

最佳答案

The svn:ignore property contains a list of file patterns which certain Subversion operations will ignore. Perhaps the most commonly used special property, it works in conjunction with the global-ignores run-time configuration option (see the section called “Config”) to filter unversioned files and directories out of commands svn status, svn add, and svn import.

The rationale behind the svn:ignore property is easily explained. Subversion does not assume that every file or subdirectory in a working copy directory is intended for version control. Resources must be explicitly placed under Subversion's management using the svn add or svn import commands. As a result, there are often many resources in a working copy that are not versioned.

Now, the svn status command displays as part of its output every unversioned file or subdirectory in a working copy that is not already filtered out by the global-ignores option (or its built-in default value). This is done so that users can see if perhaps they've forgotten to add a resource to version control.

But Subversion cannot possibly guess the names of every resource that should be ignored. Also, quite often there are things that should be ignored in every working copy of a particular repository. To force every user of that repository to add patterns for those resources to their run-time configuration areas would be not just a burden, but has the potential to clash with the configuration needs of other working copies that the user has checked out.

The solution is to store ignore patterns that are unique to the resources likely to appear in a given directory with the directory itself. Common examples of unversioned resources that are basically unique to a directory, yet likely to appear there, include output from program compilations. Or—to use an example more appropriate to this book—the HTML, PDF, or PostScript files generated as the result of a conversion of some source DocBook XML files to a more legible output format.

引用:

http://svnbook.red-bean.com/en/1.1/ch07s02.html

关于svn:ignore - 它是如何工作的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7448939/

相关文章:

svn - Unix命令剥离一行的一部分

svn - 保存 svn 更改以在另一台计算机上使用?或备份未提交的 svn 更改

svn - Android Studio:SVN如何忽略工作?

svn - 我的svn :ignore pattern?怎么了

java - 添加svn :ignore property on files that already are under control

visual-studio - 从 Visual Studio 2008 中删除 SourceSafe 集成

visual-studio - AnkhSVN 在 VS 2013 中不显示文件夹的状态图标

svn - 颠覆 : error on checkout - Mac OS 10. 5

git 知道但(远程)svn 忽略

SVN忽略项目中任何地方的文件