Remove specific files from revision history

夙愿已清 提交于 2019-12-04 01:40:47

问题


I am trying to remove specific files from the revision history that I did not mean to commit. Can someone provide a way to do this?


回答1:


You'll need to use svndumpfilter tool. The procedure involves dumping your repository, filtering (with svndumpfilter) your dumpfile, and reloading the results into a new repository. See this chapter in the SVNBook for details.




回答2:


Besides the filtering repository dump with svndumpfilter there is another solution that allows you to get rid of specific files and folders in a repository. Please see the Apache Subversion FAQ entry "How do I completely remove a file from the repository's history?".

The solution requires you to perform the following steps:

  1. Setup path-based authorization rules to deny read access for a USERNAME to the PATHS of the file or a folder you want to remove from repository history. Please note the plural noun paths. The file or folder you want to get rid of could have different names or can be located in different places across a repository history. Please consider this when setting up deny rules.

  2. Create an empty repository,

  3. Use svnsync tool to synchronize the source (i.e. the original one) repository to the target repository under account USERNAME. For details on repository replication with svnsync please refer to SVNBook chapter "Repository Replication".

Unlike svndumpfilter, svnsync will automatically translate copy operations with an unreadable source path into normal additions, which is useful if history involving copy operations needs to be filtered.




回答3:


You can't remove the revision history.



来源:https://stackoverflow.com/questions/3504851/remove-specific-files-from-revision-history

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!