简体   繁体   English

尽管propset svn:ignore,SVN也不会忽略文件夹

[英]SVN just won't ignore a folder, despite propset svn:ignore

Take folder files , inside an SVN working copy, running in Linux. 获取在Linux中运行的SVN工作副本中的文件夹文件 The folder was set to be ignored, with the commands: 使用以下命令将文件夹设置为忽略:

  • svn propset svn:ignore * 'files'
  • svn propset svn:ignore 'default/files'
  • and a few other combination, all valid AFAIK 以及其他一些组合,都是有效的AFAIK

However, the setting just doesn't kick it. 但是,设置只是没有踢它。 If the repository is accessed with a dektop client (ie Cornerstone on Mac OS) the folder is correctly reported as ignored. 如果使用dektop客户端(即Mac OS上的Cornerstone)访问存储库,则会正确报告该文件夹被忽略。

I am scratching my head real hard here. 我在这里真的很难过。

Thanks. 谢谢。

The answer that cleared it out for me is in this comment: 清除它的答案在于此评论:
If the files are already under version control, they will never be ignored. 如果文件已经受版本控制,则永远不会忽略它们。

If you want to ignore a directory files , you need to svn propset svn:ignore files on its PARENT directory, not the directory itself. 如果要忽略目录files ,则需要svn propset svn:ignore files其PARENT目录中的svn propset svn:ignore files ,而不是目录本身。

eg 例如

# your directory structure is this:
# workingCopy
# workingCopy/parent
# workingCopy/parent/subfolder
# to ignore subfolder do this:
svn propset svn:ignore subfolder workingCopy/parent

Edit 编辑

If there are files within this folder that are under version control, Subversion will NOT ignore them even if the folder is ignored. 如果此文件夹中的文件受版本控制,则即使忽略该文件夹,Subversion也不会忽略它们。 You will need to remove them from version control (ie svn delete ) and then they will be ignored. 您将需要从版本控制中删除它们(即svn delete ),然后它们将被忽略。

A file being under version control takes precedence over any ignore lists that may include it. 受版本控制的文件优先于可能包含它的任何忽略列表。

So close. 很近。

I think you wanted 我想你想要的

svn propset svn:ignore files . svn propset svn:忽略文件。

if you execute this in the parent directory of the files directory, it'll be ignored. 如果你在files目录的父目录中执行它,它将被忽略。 You won't see the effect until the parent is committed, though. 但是,在父提交之前,您不会看到效果。 And I'm pretty sure you can't ignore a directory that contains versioned files. 而且我很确定你不能忽略包含版本化文件的目录。

Finally, I always use propedit rather than propset, so I don't lose any current settings. 最后,我总是使用propedit而不是propset,所以我不会丢失任何当前设置。

How are you testing it? 你是如何测试的? If you 如果你

svn commit files

Then the ignore isn't checked. 然后不检查忽略。 If you svn commit ., then the automatic behavior of Subversion will ignore it. 如果你svn commit。,那么Subversion的自动行为将忽略它。 (This confused me at one point, too. Subversion assumes you're smarter than the svn:ignore.) (这也让我很困惑.Subversion假设你比svn聪明:忽略。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM