Delete file with all history from svn repository

后端 未结 4 1798
心在旅途
心在旅途 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 05:45

    This has recently become much more straightforward with the command svndumpfilter. Details are available in the subversion documentation here. Basically, to avoid conflicts (explained here), it takes a repo dump and redoes each commit, either including or excluding a given file prefix. Basic syntax:

    svndumpfilter exclude yourfileprefix < yourdump > yournewdump
    

    Exclude is probably what the question asker is looking for, but you can also use include to, say, extract a subtree of the repo so as to spin it off as its own repository.

    The latest revision of subversion in subversion (very meta) can also take glob patterns. I recently had to remove all pdfs from a repo and it was very easily done like so:

    svndumpfilter exclude --pattern '*.pdf' < dump > dump_nopdfs
    

    Further usage information can be found by calling svndumpfilter help and svndumpfilter help exclude.

提交回复
热议问题