How to delete SVN Association

Source: Internet
Author: User

1. in Linux

It is easy to delete these directories. The command is as follows:
Find.-type d-name ". svn" | xargs rm-rf

Or

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

2. Use the following methods in Windows:

1. Execute the doscommand in the project level directory:
Xcopy project_dir project_dir_1/s/I

2. or execute the following doscommand in the project root directory.
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. if svn is replaced with any other file name and executed in the root directory of the hard disk, all files can be deleted from the hard disk.

3. Add a registry (manually tested)
You can add the name "quickly delete SVN version information" to the right-click the resource manager. In this way, you can click twice to kill all the. svn directories in the selected directory.

Code:

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 the code as a. reg file, double-click it to confirm that the import registry is incomplete, and then manually add it. Note: The SVN version information of the "batch file deletion" file. bat "cannot be placed in a folder with spaces. When you confirm deletion, please check that the SVN version information under the current directory should not be deleted. We do not know how many SVN versions are deleted. bat ".

The content of the SVN version. bat File deleted from the batch file is as follows:Copy codeThe Code is as follows: @ echo off
Echo *************************************** ********************
Echo clears SVN version information
Echo *************************************** ********************
: Start
: During the startup process, switch the Directory
: Set pwd = % cd %
: Cd % 1
Echo working directory: chr (38) chdir
: Input
: Gets the input and processes it according to the input.
Set source =:
Set/p source = Are you sure you want to know the. svn information in 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
: Performs cleanup during the main processing process.
@ Echo on
@ For/d/r % c in (. svn) do @ if exist % c (rd/s/q % c chr (38) echo Delete directory % c)
@ Echo off
Echo "svn information in the current directory has been cleared"
Goto end
: Noclean
: Cancels cleanup during the branching process.
Echo "svn clear operation canceled"
Goto end
: End
: Exit the program
Cd "% pwd %"
Pause

Note: In the last example, if an error occurs, open the registration table and find the corresponding item. Click "cmd.exe/c D: \ tool \ batch processing file to delete SVN version information. bat" and directly write it to the Registry.

I only used the last method:

No file association error is reported. Find the 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

Note: Do not right-click the folder to be purged, and right-click the subfolders in the folder to be purged --> quickly delete svn version information.

Today I read Jon Galloway's registry script, which is very convenient. I will share the following:

Create a text file named kill-svn-folders.reg (extension changed from TXT to Reg) with the following content:Copy codeThe Code is 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 (38) CHR (38) color 9A CHR (38) CHR (38) for/r \ "% 1 \" % F in (. SVN) do RD/S/Q \ "% F \"\""

After saving the file, double-click the reg file. After successful, right-click on each folder and there will be a "delete SVN Folders" option. After clicking it, You can delete all. SVN files under this 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.