本文介绍了如何在不替换本地文件的情况下将现有目录转换为SVN工作副本(WC)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个大型的Subversion存储库,其中有将近15 GB的数据分布在约500,000个文件中.现在,我需要将此存储库签到远程主机,这需要几天的时间才能完成.

I have a large Subversion repository with nearly 15 GB of data spread across ~500,000 files. Now I need to check out this repository to a remote host which would take days to complete.

我要检出的主机已经在存储库中具有数据的完整副本.但是,由于没有直接从存储库中检出文件,因此它们不构成工作副本(没有".svn"文件夹).

The host I'm checking out to already has a complete copy of the data in the repository. But seeing as the files weren't checked out directly from the repository, they do not constitute a working copy (no ".svn" folders).

我想避免在网络上复制所有这些数据,尤其是当目标主机上已经存在这些数据时.我可以使用一种技巧来将现有目录转换为工作副本,而不必用存储库中的相同副本替换本地文件吗?

I'd like to avoid copying all this data across the network, especially when it already exists on the target host. Is there a trick I can use that will turn a preexisting directory into a working copy without replacing the local files with identical copies from the repository?

推荐答案

从SVN 1.7开始(但不包括以前的版本),您可以使用以下方法轻松实现此目的:

As of SVN 1.7 (but not before) you can do this easily with:

svn co --force http://path/to/repo

这会将本地副本视为现有副本,并且您将在输出中的每个文件名之前看到存在的"E":E some/existing/file

This will respect the local copy as existing, and you'll see the "E" for existing before each file name in the output:E some/existing/file

如果文件与存储库不同(新文件或已修改文件),它也会根据这本书:

If the file is different (new or modified) from the repository it will handle that gracefully too according to the book:

还请注意,SVN 1.7可能导致这种情况更为普遍(可能是解决方案的起因).将 sub 目录移动到磁盘上的新位置时,我遇到了此问题.在1.7之前的版本中,可以使用它移动.svn目录,并且可以单独使用.在1.7版中,该目录实际上已取消版本控制.但是svn co --force保存了这一天.

Also note that SVN 1.7 can lead to situations where this a more common problem (perhaps motivating the solution). I hit this problem when moving a sub directory to a new location on disk. In pre-1.7 that would have moved the .svn directory with it and it would have stood alone just fine. In 1.7 the directory became effectively unversioned. But svn co --force saved the day.

这篇关于如何在不替换本地文件的情况下将现有目录转换为SVN工作副本(WC)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 16:26
查看更多