How to delete .SVN files/directories
Thursday, August 13th, 2009This is so common situation when somebody decides to copy a directory that contains SVN files which also has locally modified files.
Therefore a clean export won't do the job.
Here is what I do to clean up the new folder from the SVN files.
This command will display all the .SVN folders starting from the current folder.
Be yourself i.e. not root
just in case.
find . -type d -name '*.svn' -print
Example Output:
./js/.svn
./templates/.svn
./.svn
./css/.svn
./images/.svn
What I do is check the folders visually and then use my editor to search & replace:
"./" and replace it with "rm -rf ./"
Result:
rm -rf ./js/.svn
rm -rf ./templates/.svn
rm -rf ./.svn
rm -rf ./css/.svn
rm -rf ./images/.svn
Then I paste this in the console window.
rm is a dangerous command so be careful!
Your precious work could be gone in a fraction of a second!
