How to remove untracked files in SVN

There may be a built-in way, but if so, I don’t know of it. However, something like the following should do the job:

svn st | grep '^?' | awk '{print $2}' | xargs rm -rf

(All unversioned files should appear in a line beginning with ? in an svn st.)

EDIT (@GearoidMurphy)
It’s challenging to get this snippet to work on a cygwin environment, as xargs treats the windows path slashes as escape sequences and has trouble parsing the ‘\r\n’ line endings, below is my adapted solution of this perfectly valid answer:

svn st | grep '^?' | gawk '{printf(\"%s|\", $2)}' | xargs -d "|" -n1 C:\cygwin\bin\rm -r

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)