我可以覆盖单个目录的 svn:ignore 吗?
Subversion 的默认全局忽略可以很好地将构建工件置于版本控制之外。如果我需要分发编译代码的目录来构建我的东西怎么办?
我不想获取我的输出(例如,/target
),并且我想继续忽略所有编译的代码我的大多数其他项目,但只有一个目录(例如/input
)需要始终跟踪带有.a
扩展名的文件。
我是否可以在 /input
目录上设置一个属性,使 svn add
在其中获取新的 .a
文件,而无需更改全局忽略属性?
The default global ignore for Subversion does a good job of keeping build artifacts out of version control. What if I need to distribute a directory of compiled code for my stuff to build?
I don't want to pick up my output (in, say, /target
), and I want to continue ignoring all compiled code for most of my other projects, but just one directory (say, /input
) needs to always track files with a .a
extension.
Is there a property I can set on the /input
directory that will make svn add
pick up new .a
files in there, without altering the global-ignores property?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
svn:ignore
设置是每个目录的属性。它适用于给定目录,并添加而不是覆盖全局忽略设置。请参阅 SVN 中的忽略未版本控制的项目书。我想说你有两个可行的选择:
global-ignores
设置中包含*.a
,而只在svn:ignore 中设置它此类文件经常出现的目录上的
属性,例如/target
。*.a
保留在global-ignores
设置中,并在每个.a
上手动调用svn add
您想要跟踪的文件。一旦它们被 SVN 跟踪,忽略设置将不再适用于它们。The
svn:ignore
setting is a per-directory property. It applies to a given directory, and adds to rather than overrides theglobal-ignores
setting. See Ignoring Unversioned Items in the SVN book.I would say you have two viable options:
*.a
in theglobal-ignores
setting, but rather only set it in thesvn:ignore
property on directories where such files tend to appear, such as/target
.*.a
in theglobal-ignores
setting, and manually callsvn add
on each of the.a
files you wish to track. Once they are tracked by SVN, the ignore setting will no longer apply to them.刚刚遇到这个问题并在
SmartSVN
客户端中解决(但该解决方案应该适用于其他SVN客户端)。您应该能够手动包含被忽略的文件/目录,而无需更改任何
svn:ignore
设置。您可能遇到的问题是文件可能不可见,因此您必须先显示它们。
解决方案:
Just encounter this issue and solved in
SmartSVN
Client (but the solution should be applicable to other SVN clients).You should be able to manually include an ignored file/directory without changing any
svn:ignore
settings.The problem you might have is that the files may not be visible so you will have to show them first.
Solution: