Is there a concept of global ignores in svn?

是否有方法为 SVN 存储库或 PC 上的 SVN 客户端设置一个全局忽略列表?

我使用 Tortoise/Ankh/VisualSVN 这样的工具的唯一原因是,我想只检入我需要的文件,而不需要所有 bin/obj/Resharper 的东西。

我被 .gitignore.hgignore宠坏了,我只是把它们复制到一个存储库中,然后使用 git commit -a,而不用担心检入垃圾信息。

我知道我可以手动设置它,但这是繁琐的,我认为它必须应用到每一个新的文件夹,得到创建以及。

在 Windows 下使用 SVN。

51877 次浏览

On an install of Subversion, there is a file in a path such as one of the following:

  • Windows Vista/7/8/8.1/10: C:\Users\<username>\AppData\Roaming\Subversion\config
  • 视窗 XP: c:\Documents and Settings\<username>\.subversion\config
  • Unix (Linux 等) ,macOS: $HOME/.subversion/config

包含 Subversion 的全局配置的。在 [miscellany]部分中有一个 global-ignores参数,您可以使用它来设置全局忽略的文件名模式。

Subversion 手册的 运行时配置区部分提供了更多信息,包括如果需要,如何在注册表中设置这样的全局配置参数。

典型例子:

[miscellany]
global-ignores = *.o *.so *.so.[0-9]* .DS_Store [Tt]humbs.db

或者,如果您正处于使用 Git 的过渡阶段:

[miscellany]
global-ignores = .git

如果您使用 Subversion 1.8和更新的客户端,那么它就是 可以在存储库中设置全局忽略

Subversion 1.8版本引入了 储存库口述配置特性。由于这个新特性,您可以在存储库端配置 svn:global-ignores属性。

有关更多信息,请参见 SVNBook 1.8 | 忽略未版本项SVNBook 1.8 | Inherited properties