In order to delete all ".svn" files/folders/subfolders in "myfolder" I use this simple line in a batch file:
FOR /R myfolder %%X IN (.svn) DO (RD /S /Q "%%X")
This works, but if there are no ".svn" files/folders the batch file shows a warning saying: "The system cannot find the file specified." This warning is very noisy so I was wondering how to make it understand that if it doesn't find any ".svn" files/folders he must skip the RD command.
Usually using wild cards would suffice, but in this case I don't know how to use them, because I don't want to delete files/folders with .svn extension, but I want to delete the files/folders named exactly ".svn", so if I do this:
FOR /R myfolder %%X IN (*.svn) DO (RD /S /Q "%%X")
it would NOT delete files/folders named exactly ".svn" anymore. I tried also this:
FOR /R myfolder %%X IN (.sv*) DO (RD /S /Q "%%X")
but it doesn't work either, he deletes nothing.
Right click on the project, go to Team->disconnect. It will open a popup where you select the first option: 'Also delete the SVN meta-information from file system. ' This will remove all the SVN folders automatically along with svn property files that you might forget sometimes while removing .
To remove a file from a Subversion repository, change to the directory with its working copy and run the following command: svn delete file… Similarly, to remove a directory and all files that are in it, type: svn delete directory…
The find command returns a list of all the subfolders matching “. svn”, and this is then piped to the rm command to recursively delete the directory. Running rm using the full path will remove the confirmation prompt, and the “rf” arguments will recursively delete any folder contents.
you can try
FOR /R myfolder %%X IN (.svn) DO (RD /S /Q "%%X" 2>nul)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With