Delete SVN three methods Delsvn (Windows+linux) _ Other synthesis

Source: Internet
Author: User
One, under the Linux

Deleting these directories is simple, and commands are as follows
Find. -type d-name ". SVN" |xargs RM-RF

Or

Find. -type d-iname ". SVN"-exec rm-rf {} \;


ii. under Windows, use the following:

1, in the project peer directory, the implementation of DOS command:
xcopy Project_dir project_dir_1/s/I

2, or in the project root directory to execute the following DOS command
For/r. %%a in (.) do @if exist "%%A\.SVN" rd/s/q "%%A\.SVN"

In fact, the second method can be used to do a lot of things, such as the code to replace the. SVN with any other file name and in the hard disk root directory to execute, you can remove all the files from the hard drive.

3, add the registration form (hands-on testing)
You can add the "quickly delete SVN version information" name to the right key of the explorer, so that all of the. SVN directories under the selected directory can be removed by Mouse point two.

The code is:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\FOLDER\SHELL\DELETESVN]
@= "quickly delete svn version information"

[Hkey_local_machine\software\classes\folder\shell\deletesvn\command]
@= "cmd.exe/c d:\ tools \ Batch Files Delete SVN version information. bat"
Save this code as a. reg file, double-click to confirm that the import registry is incomplete, and then add it yourself manually. Note: The file "batch file deletes SVN version information. Bat" can not be placed in a folder with a space, confirm the deletion please look at the current directory do not delete the SVN version of the list of information. Don't know how to improve "cmd.exe/c D:\ tools \ Batch Files Delete SVN version information. bat".


The batch file deletes the SVN version information. bat file reads as follows:
Copy Code code as follows:

@echo off
Echo ***********************************************************
echo Clears SVN version information
Echo ***********************************************************
: Start
:: Startup process, switching directories
: Set pwd=%cd%
: cd%1
The Echo working directory is: Chr (chdir)
: input
:: Getting input, processing according to the input
Set source=:
set/p source= sure you want to know the. SVN information under the current directory? [y/n/q]
Set "Source=%source:" =% "
If "%source%" = = "Y" goto clean
If "%source%" = = "Y" goto clean
If "%source%" = = "n" Goto Noclean
If "%source%" = = "N" goto Noclean
If "%source%" = = "Q" goto end
If "%source%" = = "Q" goto end
Goto input
: Clean
:: Main processing process, performing cleanup work
@echo on
@for/R%%c in (. svn) do @if exist%%c (rd/s/q%%c chr () echo deletes the directory%%c)
@echo off
echo "SVN information in current directory cleared"
Goto END
: Noclean
:: Branching process, canceling cleanup work
echo "SVN information clear Operation canceled"
Goto END
: End
:: Exit Program
CD "%pwd%"
Pause


Note: The last method, if there is an error, open the registry, find the corresponding entry, bar "cmd.exe/c d:\ tools \ Batch Files Delete SVN version information. Bat" write directly to the registry to use

I only used the last method:

The report file has no associated errors, find this registry key: [Hkey_local_machine\software\classes\folder\shell\deletesvn\command]
Write: "Cmd.exe/c d:\ tools \ Batch Files Delete SVN version information. bat", note the path

One more note: When using, do not right-click on the folder you want to erase, right-click on subfolders in the folder you want to erase--quickly delete SVN version information

Today I read Jon Galloway's registry script, which is very handy to share as follows:

Create a text file named Kill-svn-folders.reg (extension from txt to REG), which reads as follows:
Copy Code code as follows:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\FOLDER\SHELL\DELETESVN]
@= "Delete SVN Folders"

[Hkey_local_machine\software\classes\folder\shell\deletesvn\command]
@= "cmd.exe/c \" TITLE removing SVN Folders in%1 chr (a) Chr (in) COLOR 9A chr (a) Chr (r) for/r \ "%1\"%%f in (. SVN) do RD /s/q \ "%%f\" \ ""

After saving, double-click the reg file. After successful, the right button on each folder will have a "delete SVN Folders" option, after clicking, you can delete the file below all the. SVN file.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.