How do I add all new files to SVN

I am using an ORM which generates large amounts of files from a CLI. Is there an easy way to run the svn add on all files within a directory which appear as ? when I run svn status?

Edit These files exist in a directory tree so adding * for one directory will not work.


Solution 1:

This will add all unknown (except ignored) files under the specified directory tree:

svn add --force path/to/dir

This will add all unknown (except ignored) files in the current directory and below:

svn add --force .

Solution 2:

For reference, these are very similar questions.

These seem to work the best for me. They also work with spaces, and don't re-add ignored files. I didn't see them listed on any of the other answers I saw.

adding:

svn st | grep ^? | sed 's/?    //' | xargs svn add

removing:

svn st | grep ^! | sed 's/!    //' | xargs svn rm

Edit: It's important to NOT use "add *" if you want to keep your ignored files, otherwise everything that was ignored will be re-added.

Solution 3:

you can just do an svn add path/to/dir/* you'll get warning about anything already in version control but it will add everything that isn't.