Is there a concept of global ignores in svn?
Asked Answered
S

2

79

Is there a way to setup a global list of Ignores for a SVN Repository or for the SVN Client on the PC?

The only reason I'm using tools like Tortoise/Ankh/VisualSVN is because I want to only check in the files I need without all the bin/obj/Resharper stuff.

I'm spoiled by .gitignore and .hgignore which I just copy to a repository and then use git commit -a without having to care about checking in junk.

I know I can manually set it, but that's tedious to do and I think it had to be applied to every new folder that gets created as well.

Using SVN under Windows.

Simasimah answered 22/4, 2010 at 22:12 Comment(4)
While the accepted answer is valid, bahrep's answer is what the OP was asking for and is a better workflow. Please check out his answer instead of doing this locally.Connacht
Have you tried looking at the svn propset svn:ignore "*.myextension" . command?Candlenut
@IgorGanapolsky, I think it should be rather svn propset --recursive svn:ignore "*.myextension" .. However, such ignore will not apply for new folders which are created afterwards. Use svn:global-ignores for general ignore.Appal
See also How do I ignore files in Subversion? which has answers for global ignores.Gerlach
K
94

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
  • Windows XP: c:\Documents and Settings\<username>\.subversion\config
  • Unix (Linux, etc), macOS: $HOME/.subversion/config

that contains a global configuration for Subversion. In the [miscellany] section is a global-ignores parameter which you can use to set up globally ignored filename patterns.

The Runtime Configuration Area section of the Subversion book has more information, including how to set up such global configuration parameters in the registry if you need to.

Typical examples:

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

or perhaps if you are in a transition phase to using Git:

[miscellany]
global-ignores = .git
Kohinoor answered 22/4, 2010 at 22:19 Comment(6)
It's in %AppData%\Subversion for me.Atalanta
Cool, that works. I'd still prefer per repository, but this doesn't require propedit so it's better IMHO.Simasimah
It's possible to use svn:global-ignores property on repository side if you use Subversion 1.8 client: subversion.apache.org/docs/release-notes/…Leisure
~/.subversion/config or /etc/subversion/config for Mac/Linux and %appdata%\subversion\config for WindowsQuietism
Could only find it under C:\Users\<username>\AppData\Roaming\Subversion.Selffulfillment
Windows Vista/7/8/8.1/10: %appdata%\subversion\configTallie
L
43

It is possible to setup global ignores in a repository if you use Subversion 1.8 and newer client.

Subversion 1.8 release introduced the Repository Dictated Configuration feature. Thanks to this new feature, you can configure the svn:global-ignores property on repository side.

See SVNBook 1.8 | Ignoring Unversioned Items and SVNBook 1.8 | Inherited properties for more information.

Leisure answered 10/12, 2013 at 15:4 Comment(1)
For usage example, see this answer.Gerlach

© 2022 - 2024 — McMap. All rights reserved.