Delete file with all history from svn repository

后端 未结 4 1795
心在旅途
心在旅途 2020-12-01 05:14

Is there any way to delete file from svn repository including all its history? This issue emerges when I want to get rid of large binary file residing in repo.

I kn

4条回答
  •  再見小時候
    2020-12-01 06:03

    I was facing a similar issue, except that I needed to remove multiple files, not just one file, and also we are on Subversion 1.6 which doesn't support the --patern directive.

    -- backup current SVN

    $ cp -R /svn  /svnSAVE
    

    -- dump repository

    $ svnadmin dump /svn/root > svnDump
    

    -- create new dump while excluding the very large file

    $ svndumpfilter exclude "/path/file.csv" < svnDump > newSvnDump0
    -- {note: should see a message like this}:
    --          Dropped 1 node:
    --                  '/path/file.csv'
    

    -- create another new dump while excluding another very large file

    $ svndumpfilter exclude "/path/anotherFile.csv" < newSvnDump0 > newSvnDump1
    

    -- remove the old svn

    $ rm -rf /svn
    

    -- recreate the svn directories

    $ mkdir -p /svn/root
    

    -- recreate the SVN

    $ svnadmin create /svn/root
    

    -- repopulate the fresh repository with the dump

    $ cat newSvnDump1 | svnadmin load /svn/root
    

    -- update the conf files from the saved copy into the new copy...

    $ cp /svnSAVE/root/conf/* /svn/root/conf
    

    Now the repository should not contain the 2 large files "file.csv" and "anotherFile.csv"

提交回复
热议问题