Subversion: remove all the deleted files from a repository

In order to remove all the files from the repository after they have been deleted from disk you have a couple of options.

Using Sed:

svn st | grep '^!' | sed 's/! *//' | xargs -I% svn rm %

Or with AWK:

svn st | grep '^!' | awk '{print $2}' | xargs -I% svn rm %

If you don’t trust these commands (you shouldn’t but nowadays we don’t have enough time right?) you can see the list of files that will be removed from the repository without the xargs part:

svn st | grep '^!' | sed 's/! *//'

Or:

svn st | grep '^!' | awk '{print $2}'

I think AWK is more elegant in this case since it seems more obvious to me to print the second column than removing the “!” part, but that’s just my opinion.

Happy coding!