Wednesday, November 23, 2011

Tip: Quickly delete all unversioned SVN files


I was looking for a quick way to delete all my unversioned SVN files. If you have PowerShell, I came across this very simple command
(svn status --no-ignore) -match '^\?' -replace '^\?\s+' | rm

It finds all matches from the out put of ‘svn status’ command, and then replaces the ‘?’ followed by bunch of white spaces (\s+) to get you the list of files that are unversioned. These files are then removed with the ‘rm’ command.

No comments:

Post a Comment