Colleagues, I want to offer you a small script (PowerShell) that deletes all files that are not included in the repository from the Subversion working copy:
powershell -command "(svn status --no-ignore)
| ? {$ _ -match '^ [I \?]'}
| foreach {$ _ -replace '^. \ s +'}
| rm -recurse -force "
But the modification that leaves the files
* .suo and
* .user :
')
powershell -command "(svn status --no-ignore)
| ? {$ _ -match '^ [I \?]' -and $ _ -notmatch '\ .suo $ | \ .user $'}
| foreach {$ _ -replace '^. \ s +'}
| rm -recurse -force "
What is it for? Sometimes it is very useful to do a clean build, and the
svn update command on a large project runs much faster than
svn checkout .
AcknowledgmentsThe idea belongs to my good friend, who categorically refused me to mention it :)