Add every unversioned file to version control

23 Apr 2010

You want to recursively seek every unversioned file in a directory, and add them to your svn repository.

First, to list the unversioned files, you can use

$ svn st | grep '^?'

and to add all of them to your repository

$ svn st | awk '($1 == "?") { print "svn add", $2 }' | sh

As usual, you might want to check for sanity and run this command without the last sh pipe first.

This recipe is the base of a script on github: svn-unvers.