简体   繁体   中英

How do I set `svn:global-ignores` in Subversion 1.8?

There's a new svn:global-ignores thing in Subversion 1.8 but even after reading the very wordy documentation from the retro site:

http://svnbook.red-bean.com/en/1.8/svn.advanced.props.special.ignore.html

I still am none the wiser about what this string svn:global-ignores actually is and how I set it?

My goal is to set an ignore pattern for the whole team, like how in Git there's an ignore file for the repo that's in the repo.

Thank you!

PS Do I need a particular server version or is this a client thing?

You must use a "versioned property" set on the root directory of the repository called svn:global-ignores . This is new in v1.8 and applies recursively.

There is also svn:ignore which applies to the directory its set on only. It can be set recursively, but doesn't work the same way as the above, so new directories won't 'receive' the setting.

svn propset svn:global-ignores {newline delimited ignore patterns}

Now I couldn't work out how to set newline-delimited data in a Windows Command Prompt so I just used the Properties editor in TortoiseSVN.

I remove my local Tortoise ignore list and tested with a Thumbs.db file and the setting seems to work down the tree. The property is written to the repo and must be committed like a code change. Done.

From the SVN book:

Unlike svn:ignore however, the svn:global-ignores property is inheritable and applies to all paths under the directory on which the property is set, not just the immediate children of the directory

Of course only a 1.8 or newer Subversion client will recognize the inheritability and special meaning of the svn:global-ignores property!

how I set it?

svn help ps will output help for using the "ps" command (short for "propset").

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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