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

发布于 2024-12-05 04:09:37 字数 361 浏览 0 评论 0原文

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

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

希望我已经说清楚了。

感谢您提供的任何帮助。

I have difficult in understanding the svn:ignore property. It would be nice if someone could help me on this.

I checked out a grails web app from a svn repository that has svn:ignore property applied for *.log files and /target folder. Obviously, when I checked out the *.log files and /target folder was missing. After working on this grails app on my local working copy, the /target directory and *.log files gets created. Now, when I commit the changes into the svn repo, will the /target files and *.log files get committed too? or will they be automatically ignored because of the svn:ignore property already existing on the svn copy of the grails app?

Hope I have made myself clear.

Thanks for any help offered.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

晚风撩人 2024-12-12 04:09:37

svn:ignore 属性包含一个文件模式列表,其中某些
Subversion 操作将被忽略。也许最常用的
特殊属性,它与 global-ignore 结合使用
运行时配置选项(参见“配置”部分)
从命令 svn status 中过滤未版本控制的文件和目录,
svn add 和 svn import。

svn:ignore 属性背后的基本原理很容易解释。
Subversion 并不假设 a 中的每个文件或子目录
工作副本目录用于版本控制。资源必须
使用 svn add 明确置于 Subversion 的管理之下
或 svn import 命令。因此,往往有很多资源
没有版本控制的工作副本。

现在,svn status 命令显示为其输出的一部分
工作副本中尚未受版本控制的文件或子目录
通过 global-ignores 选项(或其内置默认值)过滤掉
价值)。这样做是为了让用户可以看到他们是否已经
忘记将资源添加到版本控制。

但是 Subversion 不可能猜测出每个资源的名称
应该被忽略。而且,很多时候,有些事情是应该的
在特定存储库的每个工作副本中被忽略。给力
该存储库的每个用户都可以将这些资源的模式添加到
他们的运行时配置区域不仅是一种负担,而且
与其他工作的配置需求发生冲突的可能性
用户已签出的副本。

解决方案是存储忽略模式是唯一的
给定目录中可能出现的资源
本身。无版本资源的常见示例基本上是
目录独有,但可能出现在那里,包括来自的输出
程序编译。或者——举一个更合适的例子
book——作为结果生成的 HTML、PDF 或 PostScript 文件
将一些源 DocBook XML 文件转换为更清晰的输出
格式。

参考:

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

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.

Reference:

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

回首观望 2024-12-12 04:09:37

svn:ignore 属性包含某些 Subversion 操作将忽略的文件模式或目录名称列表。如果您将更改提交到 svn 存储库,则 /target 文件和 *.log 文件将不会被提交,并且它们会被自动忽略,因为 svn:ignore 属性已存在于 grails 应用程序的 svn 副本上。

The svn:ignore property contains a list of file patterns or directory names which certain Subversion operations will ignore. If you commit the changes into the svn repo, the /target files and *.log files will not be committed and they are automatically ignored because of the svn:ignore property that already exists on the svn copy of the grails app.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文