How to delete the file and folder of of attachment recovery method completely in SVN

  • 2020-04-01 03:26:33
  • OfStack

Assuming that the directory of SVN project is /data/ SVN /project, we want to exclude trunk/test.exe and trunk/ notaltrunk/directory.

Start by exporting the entire SVN library
  Svnadmin dump/data/SVN/project > Project_original. Dump
  Then remove unwanted files from the project_original.dump file and generate a new dump file
  Dump | svndumpfilter excludes trunk/test.exe trunk/ notaltrunk > 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 change project_new to project. It is important to note that the dump command will export all the modifications and history in the SVN project, so the exported dump file will be large and the import time will be long.

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

To delete a folder or file from the SVN library completely, use this method (for example):

Example: suppose the SVN library path is E:/ SVN /project, and the directory structure in the library is
QA/Trunk
Software/Tags/test. Exe

Delete the test.exe file in the Software/Tags/ directory

The operation steps are as follows:
Dump the SVN library
Use svndumpfilter to filter out files to be deleted
Create a new SVN library
Load the processed files into the new SVN library
The specific command is:
> Svnadmin dump E: / SVN/project > Aaa. Dump
> 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 newly created project_new to project, and the previous project can be removed, or a different name can be used (because the SVN directory used in TRAC is project, and the SVN directory used by the user is also project).

This method can completely delete a folder or file in the SVN version library if there are not many versions in the SVN version library, but if there are too many versions in the SVN version library, the storage space will be insufficient to dump the version. It's not going to work. At this time must be attached to meet its storage space of the hard disk operation.

How does SVN recover a deleted file or folder

Using TortoiseSVN:
1. In local working copy, TortoiseSVN-> Show log looks at the history of the version library. You can use search.
2. Find the version that will delete the file or folder, and right-click Revert the changes from this revision in Log message.
3. The file or folder is restored to the local working copy. If it is deleted by mistake, the commit is in the Repository.

Use Eclipse's Subclipse plugin:
In the Team - > Show SVN Repository History looks at the History of the Repository.
2. Locate the version of the file or folder that was deleted, and right-click Revert to XX version.
3. The file or folder is restored to the local working copy. If it is deleted by mistake, the commit is in the Repository.


Related articles: