简体   繁体   English

在Subversion中更改目录结构

[英]Changing the Directory Structure in Subversion

How do I create a branch in subversion that is deeper' than just the 'branches' directory? 如何在subversion中创建一个比'branches'目录更深的分支?

I have the standard trunk , tags and branches structure and I want to create a branch that is several directories deeper than the 'branches' tag. 我有标准的trunktagsbranches结构,我想创建一个比'branches'标签更深的几个目录的分支。

Using the standard svn move method, it gives me a folder not found error. 使用标准的svn move方法,它给我一个找不到文件夹的错误。 I also tried copying it into the branches folder, checked it out, and the 'svn move' it into the tree structure I wanted, but also got a 'working copy admin area is missing' error. 我也尝试将它复制到branches文件夹中,检查出来,然后'svn'将它移动到我想要的树结构中,但也有一个'工作副本管理区域丢失'错误。

What do I need to do to create this? 我需要做些什么来创建它?

For the sake of illustration, let us suppose I want to create a branch to go directly into 'branches/version_1/project/subproject' (which does not exist yet)? 为了便于说明,让我们假设我想创建一个分支直接进入'branches / version_1 / project / subproject'(它还不存在)?

svn copy --parents http://url/to/subproject http://url/to/repository/branches/version_1/project/subproject

那应该创建你想要放置子项目的目录( - --parents表示“为我创建中间目录”)。

Since subversion doesn't actually think of branches as anything special other than more directories, you can always just create the directory tree you want (with svn mkdir) then copy the code you want into the tree location. 由于subversion实际上并没有将分支视为除了更多目录之外的任何特殊分支,因此您始终只需创建所需的目录树(使用svn mkdir),然后将所需的代码复制到树位置。

Or just use the --parents flag @BlairC mentioned. 或者只使用提及的@Barents标志@BlairC。

I second the use of TortoiseSVN, simply right-click on the directory and go to TortoiseSVN->Branch/tag... to quickly create a branch at a specified directory. 我第二次使用TortoiseSVN,只需右键单击该目录并转到TortoiseSVN-> Branch / tag ...即可在指定目录中快速创建分支。 Be sure to fill out the URL to be what you want it to be on the resulting "Copy (Branch / Tag)" dialog window. 请务必在生成的“复制(分支/标记)”对话框窗口中填写所需的URL。

If you're using TortoiseSVN , you can use its Repository Explorer to do such things. 如果您正在使用TortoiseSVN ,则可以使用其资源库资源管理器来执行此类操作。 Makes it all pretty WYSIWYG simple. 使所有WYSIWYG变得简单。

SVN doesn't really manage your branches. SVN并不真正管理您的分支机构。 It simply does a wholesale copy. 它只是批发副本。 It's up to you how you want to manage it. 由您决定如何管理它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM