Delete the. svn file in a directory and its sub-directories at all levels

Source: Internet
Author: User
Tags version control system

Two methods
[1] Use the Find command and its action to implement
[2] Direct implementation with RM
$ cd/tmp/xxx
$ Rm-rf ' Find. -name. SVN '
can be achieved.

Remove SVN directory and remove SVN repository files from server side

    In the
      process of learning svn, you may encounter such problems, how to delete the SVN directory? How do I completely remove some folders or folders from the SVN repository from the server side? This article is for you to answer.

Delete SVN directory
When the SVN version control system is used, there will be one in each directory. The SVN directory exists, and when the product is delivered or uploaded to the server it is generally necessary to remove these directories, which summarizes the methods under Linux and win.

First, delete svn under Linux

Deleting these directories is simple and the command is as follows
Find.-typed-name ". SVN" |xargsrm-rf
Or
Find.-typed-iname ". svn"-execrm-rf{}\;
All done. (Http://tech.techweb.com.cn/redirect.php?fid=26&tid=205673&goto=nextnewset)

Second, remove SVN under Windows with the following:

1, in the project peer directory, the implementation of DOS command:
xcopyproject_dirproject_dir_1/s/i

2. Or execute the following DOS command in the project root directory
For/r.%%ain (.) [Email protected] "%%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 in the. SVN replaced with any other file name and executed at the root of the hard disk, you can delete all the files from the hard disk.

3, plus registration form
Jongalloway provides a registry code that adds "Deletesvnfolders" to the right-hand side of the explorer, so that all the. SVN directories under the selected directory can be killed by Mouse point two. worksjustgreat!
The code is:
Windowsregistryeditorversion5.00[hkey_local_machine\software\classes\folder\shell\deletesvn]@= " Deletesvnfolders "[hkey_local_machine\software\classes\folder\shell\deletesvn\command]@=" Cmd.exe/c\ " Titleremovingsvnfoldersin%1&&color9a&&for/r\ "%1\"%%fin (. svn) dord/s/q\ "%%f\" \ "" Save this code as a. reg file, and double-click Confirm to import the registry.


Completely remove some folders or folders from the SVN repository from the server side
To completely remove a folder or file from the SVN repository, take this approach (for example):

Example: Assuming that the SVN library path is E:\svn\project, the directory structure in the library is
Qa/trunk
Software/tags/test.exe
Delete the Test.exe file under the software/tags/directory

The operation steps are:
Dump the SVN vault.
Use Svndumpfilter to filter out the files you want to delete
Create a new SVN repository
Then load the processed files into the new SVN repository.
The specific commands are:
>svnadmindumpe:\svn\project>aaa.dump
>typeaaa.dump|svndumpfilterexclude/software/tags/test.exe>bbb.dump
>svnadmincreatee:\svn\project_new
>svnadminloade:\svn\project_new<bbb.dump
Then rename the newly created Project_new to project, and the previous project can be moved, or another name will be taken. (Because the SVN directory used in TRAC is project, the SVN directory used by the user is also project)

This method can completely remove the SVN repository in the case of a few versions of the folder or file, but if the SVN repository version too many, in the dump version of the time due to insufficient storage space, and cannot dump version. will not be able to operate. The hard drive operation that can satisfy its storage space must be hung separately.

"Editor's recommendation"

        1. Technology sharing: How to delete svn backup library
        2. How to remove SVN and its recovery problem teacher pointing
        3. Effective way to remove SVN version information
        4. SVN basic Operation Novice on the road
        5. How do I remove SVN version information under Lniux and Windows?

Delete the. svn file in a directory and its sub-directories at all levels

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.