博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Permanently remove files from SVN
阅读量:6090 次
发布时间:2019-06-20

本文共 1874 字,大约阅读时间需要 6 分钟。

  hot3.png

 

1. Make sure nobody else uses the repo at the time

 

I think the easiest way would be to remove write-permissions from the repository-folder. E.g. if you access your svn through apache, just chown it from www-data to root and nobody should be able to write anymore:

 

#chown -R root:root /var/svn/REPOSITORY 

 

2. Dump your repository to a dumpfile

 

#svnadmin dump /var/svn/REPOSITORY > dumpfile 

 

3. Filter the dumpfile

 

svndumpfilter exclude /path/of/file/to/remove < dumpfile > newdumpfile

 

This will remove the file “/path/of/file/to/remove”. You can remove multiple files at a time like this:

 

#svndumpfilter exclude file1 file2 < dumpfile > newdumpfile

 

you can also use wildcards:

 

#svndumpfilter exclude –pattern "*.OLD" < dumpfile > newdumpfile 

 

4. Create a new repository

 

#svnadmin create /var/svn/REPOSITORY_NEW

 

5. Import the dumpfile in the new repository

 

#svnadmin load /var/svn/REPOSITORY_NEW < newdumpfile 

 

6. Replace the old with the new repository

 

#chown -R www-data:www-data /var/svn/REPOSITORY_NEW

 

#mv /var/svn/REPOSITORY /var/svn/REPOSITORY_OLD 

 

#mv /var/svn/REPOSITORY_NEW /var/svn/REPOSITORY  

 

In the first line I also changed the file owner and group to www-data to make the new repository accessible for apache. In case you do not use apache (e.g. svnserve), skip the line or change the file owner and group to your needs (see what the owner of the old repo was using “ls -l /var/svn” ).

 

7. Check it

 

You update your working copy (shouldn’t change anything). But when you browse your history and want to see one of the files you removed, you will get an error that the file could not be found.

You might want to make a fresh checkout and a commit to see whether everything still works as expected…

 

8. Clean up

 

In case everything went well, you can delete a couple of things:

 

#rm -R dumpfile newdumpfile /var/svn/REPOSITORY_OLD 

 

转载于:https://my.oschina.net/hook7/blog/293290

你可能感兴趣的文章
Oracle 主键自增 Native Sequence两种方式
查看>>
Javascript单元测试框架比较Qunit VS Jasmine
查看>>
指令汇B新闻客户端开发(三) 下拉刷新
查看>>
PeopleSoft Intergration Broker 设置及实列
查看>>
ffmpeg-20160831-bin.7z
查看>>
Git使用的常用命令
查看>>
微软职位内部推荐-Senior Software Engineer
查看>>
Python基础知识之装饰器
查看>>
jQuery匹配各种条件的选择器用法
查看>>
多线程开发
查看>>
uva-10167-枚举
查看>>
ES6 函数参数的解构赋值
查看>>
英语发音规则---O字母
查看>>
网络工程师课程---3、IP与路由器(ip地址的主要作用是什么)
查看>>
js插件---强大的图片裁剪Cropper
查看>>
20145328 《Java程序设计》第0周学习总结
查看>>
串口通信编程--多线程异步方式
查看>>
撤销 git reset --hard HEAD~1
查看>>
.a是否支持arm64
查看>>
求有序数组中不重复数字的出现次数
查看>>