简体   繁体   中英

Setting svn:ignore property on files that are not version controlled

I have a project I'm wanting to add to a new, empty SVN directory. I've checked out that SVN directory into the root of the project and now need to add all the files in that directory before committing.

However, one of the sub-directories (./sites/default/files) has a bunch of folders comprising 20 gigabytes of images. I do not want to add this folder to the working copy. Alas, it seems I cannot set the svn:ignore property on that directory because its parent is not yet version controlled -- I get a "not a working copy" error when I do so:

$ svn propset svn:ignore files .
svn: '.' is not a working copy

Temporarily moving that directory below the project's parent directory is not an option; the codebase is for a live site that I'm adding to SVN very late in the game.

How would I do what I'm wanting to do, assuming I don't want to go through and manually add every single directory in the tree one-by-one?

Thanks!

Add the ./sites/default folder using the --depth=empty flag which will then allow you to add the files directory to svn:ignore.

svn add --depth=empty ./sites/default

then

svn propset svn:ignore files .

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