Question

Add all unversioned files to SVN

I have a working copy that gets automatically committed into SVN overnight using a script.

I use the SVN command line to do so.

After a frustrating battle with Google, I have been unable to work out how to automatically add all unversioned files in the working copy to the repository before the commit.

Does anyone know how I might go about doing this?

Kindness and thanks in advance,

Dan

 45  28634  45
1 Jan 1970

Solution

 74
svn --force --depth infinity add .

Be careful, though, because this will also add any svn:ignore'd files.

2009-10-21

Solution

 32

The accepted solution

svn --force add .

will also add all ignored unversioned files. Most people likely prefer just to add all unversioned but not ignored files.

To add all unversioned but not ignored files, codefox421 answer is right:

svn st | grep '^\?' | sed 's/^\? *//' | xargs -I% svn add %

as svn st does not show ignored files.

2013-11-20