How to completely delete files and folders in SVN (with recovery method) _java

Source: Internet
Author: User
Tags svn versions tortoisesvn

This assumes that the SVN project directory is/data/svn/project, we want to exclude Trunk/test.exe files and trunk/notallowed/directories, the following steps and the SVN command executed (under the bin directory of the SVN installation directory) are as follows:

# First, the entire SVN library is exported
Svnadmin dump/data/svn/project > Project_original.dump
# then remove the unwanted files from the Project_original.dump file and generate a new dump file
Type Project_original.dump | Svndumpfilter exclude Trunk/test.exe trunk/notallowed > Project_new.dump
# Next create a new SVN project and import the dump file above into a new project
Svnadmin create/data/svn/project_new
Svnadmin Load/data/svn/project_new < Project_new.dump

Finally, delete the original project directory and modify Project_new to project. It is important to note that the dump command exports all modifications and histories from the SVN project so that the exported dump file is large and the import time is longer.

Remove some folders or files from the SVN version Gallery from the server side completely

To completely delete a folder or file in the SVN version library, take this approach (for example):

Example: Assuming 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 in the software/tags/directory

Action steps are:
Dump the SVN library.
Use Svndumpfilter to filter out files for deletion
Create a new SVN library
and load the processed files into the new SVN repository.
The specific commands are:
>svnadmin Dump E:/svn/project > Aaa.dump
>type Aaa.dump | Svndumpfilter Exclude/software/tags/test.exe > Bbb.dump
>svnadmin Create E:/svn/project_new
>svnadmin Load E:/svn/project_new < Bbb.dump

Then rename the new Project_new to project, and the previous project can be moved, or a different 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 a folder or file from the SVN version library if there are few versions in the SVN repository, but if there are too many versions in the SVN repository, the dump version will not be able to dump because of insufficient storage space. Can not operate it. In this case, you need to hang another hard drive that satisfies its storage space.

svn How to recover deleted files or folders

With TortoiseSVN:
1. In local working copy, use the Tortoisesvn->show log to view the history of the version library. You can use search.
2. Find the deletion of the file or folder version, in log message right revert the changes from this revision.
3. The file or folder is restored to the local working copy. If it is mistakenly deleted, commit to the repository in the line.

Use Eclipse's Subclipse plug-in:
1. Team->show SVN Repository History View the history of the version library.
2. Find the version that deletes the file or folder, right-revert to Xx.
3. The file or folder is restored to the local working copy. If it is mistakenly deleted, commit to the repository in the line.

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.