Renaming an SVN(Subversion) Repository

4 篇文章 0 订阅

最近SVN再做规范化,有些资料库名字需要更新,因此网上找了如下的方法还是挺好用的

What is SVN (Subversion)?

If you don't know what SVN is and you're reading this page, you probably got here by mistake. That's OK! However, you will probably not benefit much from this tutorial

If you decided to stick around, SVN is document versioning software commonly used by software developers as a repository for source code. Like CVS, GIT and Miscrosoft Source Safe SVN allows multiple users to work on the same document and it keeps track of changes to the documents.

If you still want to learn more, go to subversion.tigris.org

The issue: Renaming a Repository

Ok, so here's the scenarion: We have an SVN repository and we want to change it's name.

The problem is that SVN doesn't have a Rename Repository command we could use.

Why would anyonewant to rename an SVN repository? - that's a good question, and the the answer, I'm sure, depends on the case. Maybe you started off with a name for a project and later you decided to change it.

The solution: svnadmin dump & svnadmin load

The correct way to do this is to actually create a repository with the new name, and then import all revisions from the old repository into the newly created one. This way, all the revision history will be preserved(这是我要的啊~)

So, first we create a repositroy with the new name. Assuming /path/to/new/repository/ is the path where you want the new repository to be created, and <new-repo-name> is the new name, the command would look like this..

svnadmin create /path/to/new/repository/<new-repo-name>

Then we dump all the data from the old respository into a file called old-repo.dump. We will assume /the/path/to/old/repository/ is the path to the repository and that the old repository was called old-repo-name.

svnadmin dump /the/path/to/old/repository/<old-repo-name> > old-repo.dump

Now, we can import the dump file into the newly created repository. In order to to that we use the load svn command.

svnadmin load /the/path/to/new/repository/<new-repo-name> < old-repo.dump

Wrapping up

One thing to note is that for this method to be successfull, the newly created repository has to be empty. Otherwise you may get all sorts of errors and/or funny results.

The other observation that I would make is that in case of a large project, this process may take a while and the resulting dump file and new repository may be rather large.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值