简体   繁体   English

使用TortoiseSVN创建一个没有/ trunk结构的分支

[英]Creating a branch with TortoiseSVN without /trunk structure

Background: We have our source code saved in an SVN repository at our own server. 背景:我们的源代码保存在我们自己的服务器的SVN存储库中。 We have Team A working on the main functionality of the website. 我们让A队正在研究网站的主要功能。 We are looking to work with a Team B on the design aspects which will be at a different location. 我们希望与B团队就设计方面进行合作,这些设计方面将位于不同的位置。

A long time back when setting up the SVN repository, I created it with a structure which was finally accessible at: 很长一段时间,在设置SVN存储库时,我创建了一个最终可访问的结构:

svn://www.myserver.com/main/abc

The source code files are present at the 'abc' level and in folders below that. 源代码文件出现在'abc'级别和下面的文件夹中。

This has been working fine for us until now when I need to create a branch. 到目前为止,我需要创建一个分支,这对我们来说一直很好。 Choosing TortoiseSVN → Branch/Tag seems to give me the option of creating a branch at: 选择TortoiseSVN→分支/标签似乎让我可以选择在以下位置创建分支:

svn://www.myserver.com/main/def

However, when I tried it last, it seemed to create a folder WITHIN 'abc' named 'def' which wasn't what I was expecting at all. 但是,当我最后一次尝试时,它似乎创建了一个名为'def'的文件夹WITHIN'abc',这根本不是我所期待的。 I was hoping to create a completely separate copy of the repository which Team B could work on, and when it came time to merge the two - that could happen as smoothly as possible. 我希望创建一个完全独立的存储库副本,B团队可以使用它,当合并两者时 - 可能会尽可能顺利地进行。

[I understand that when committing changes in 'abc', we will also have to commit in 'def'] [我明白,当'abc'进行更改时,我们还必须提交'def']

A branch in svn is nothing more than a copy. svn中的一个分支只不过是一个副本。 If you're using an interface that gives the name "trunk" and "branches" special meaning (and the way you describe it, it seems that TortoiseSVN does so), try to avoid its branching function and simply create a copy directly. 如果你正在使用一个名称为“trunk”和“branches”的特殊含义的接口(以及你描述它的方式,看起来TortoiseSVN就这样做了),试着避免它的分支功能并直接创建一个副本。 If you check out svn://www.myserver.com/main/, and then copy abc to def, you're all set. 如果您查看svn://www.myserver.com/main/,然后将abc复制到def,那么您已经完成了设置。 Team B can then check out svn://www.myserver.com/main/def. 然后B队可以查看svn://www.myserver.com/main/def。

Extended version of Hvd's answer Hvd答案的扩展版本

Repository layout is nothing more than accepted agreement about using tree. 存储库布局只不过是关于使用树的接受协议 You can store mainline and side-work in any place of repository tree, while they aren't intersected. 您可以将主线和侧面工作存储在存储库树的任何位置,而它们不会相交。

In your description of current state of repo you miss one important thing: Where is repository root , on which level? 在您对当前repo状态的描述中,您会错过一件重要的事情: 存储库根目录在哪个级别? Both situations "/main/" and "abc/" are solvable , but with different steps. 两种情况“/ main /”和“abc /” 都是可解决的 ,但步骤不同。

You can easy detect root even remote, using TSVN's Repository Browser. 使用TSVN的Repository Browser,您甚至可以轻松检测到root甚至是远程。 Can you access svn://www.myserver.com/main/ URL as repository or you'll get error? 你可以访问svn://www.myserver.com/main/ URL作为存储库,否则你会收到错误?

Second question, related to repo-root is "Which URL TeamA use now for accessing repo?" 与repo-root相关的第二个问题是“Team TeamA现在使用哪个URL来访问repo?” Yes, I read and understand 是的,我阅读并理解

structure which was finally accessible at svn://www.myserver.com/main/abc 最终可以在svn://www.myserver.com/main/abc访问的结构

but it leave some space for assumptions: 但它为假设留下了一些空间:

  • does TeamA checkout from svn://www.myserver.com/main/ and have ABC dir inside working copy 从svn://www.myserver.com/main/结帐TeamA并在工作副本中使用ABC目录
  • does TeamA checkout from svn://www.myserver.com/main/abc and have wotking space at the root immediatelly 来自svn://www.myserver.com/main/abc的TeamA结账并立即在根目录中提供wotking空间

(first version and svn://www.myserver.com/main as root from Q1 will require later re-checkout repository in order to exclude common root with TeamB space) (第一个版本和svn://www.myserver.com/main作为Q1的root用户将需要以后重新签出存储库以便排除TeamB空间的公共根目录)

Resume 恢复

Find Repo-root, write it for us, we'll outline next steps in any case 查找Repo-root,为我们写,我们将概述下一步的步骤

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

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