我在Subversion(以及一般的存储库)讨论中经常看到这些词。 在过去的几年里,我一直在我的项目中使用SVN,但是我从来没有掌握这些目录的完整概念。
它们是什么意思?
我在Subversion(以及一般的存储库)讨论中经常看到这些词。 在过去的几年里,我一直在我的项目中使用SVN,但是我从来没有掌握这些目录的完整概念。
它们是什么意思?
当前回答
One of the reasons why everyone has a slightly different definition is because Subversion implements zero support for branches and tags. Subversion basically says: We looked at full-featured branches and tags in other systems and did not found them useful, so we did not implement anything. Just make a copy into a new directory with a name convention instead. Then of course everyone is free to have slightly different conventions. To understand the difference between a real tag and a mere copy + naming convention see the Wikipedia entry Subversion tags & branches.
其他回答
它们没有任何正式的含义。文件夹就是文件夹 SVN。它们是组织项目的一种普遍接受的方式。
The trunk is where you keep your main line of developmemt. The branch folder is where you might create, well, branches, which are hard to explain in a short post. A branch is a copy of a subset of your project that you work on separately from the trunk. Maybe it's for experiments that might not go anywhere, or maybe it's for the next release, which you will later merge back into the trunk when it becomes stable. And the tags folder is for creating tagged copies of your repository, usually at release checkpoints.
但正如我所说,对于SVN,文件夹就是文件夹。分支、主干和标签只是一种约定。
我随意使用“复制”这个词。SVN实际上并不完全复制存储库中的内容。
标签=在时间上定义的片段,通常用于发布
我认为这就是人们通常所说的“标签”。但是在Subversion中:
它们没有任何正式的含义。文件夹对于SVN来说就是一个文件夹。
我觉得很困惑:一个对分支或标签一无所知的修订控制系统。从实现的角度来看,我认为创建“副本”的Subversion方式非常聪明,但我必须了解它,这就是我所说的有漏洞的抽象。
或者我使用CVS的时间太长了。
中继目录可能是您最熟悉的目录,因为它用于保存最新的更改。你的主要代码库应该在trunk中。
分支目录用于保存分支,无论它们是什么。
标签目录主要用于标记一组特定的文件。您可以对发布版本这样做,其中您希望“1.0”是这些修订版本的这些文件,“1.1”是这些修订版本的这些文件。通常,标签制作完成后就不需要修改了。有关标签的更多信息,请参见第4章。分支和合并(在Subversion版本控制中)。
嗯,我不确定我同意尼克重新标签类似于一个分支。标签只是一个标记
Trunk would be the main body of development, originating from the start of the project until the present. Branch will be a copy of code derived from a certain point in the trunk that is used for applying major changes to the code while preserving the integrity of the code in the trunk. If the major changes work according to plan, they are usually merged back into the trunk. Tag will be a point in time on the trunk or a branch that you wish to preserve. The two main reasons for preservation would be that either this is a major release of the software, whether alpha, beta, RC or RTM, or this is the most stable point of the software before major revisions on the trunk were applied.
在开源项目中,不被项目涉众接受的主要分支可以成为分叉的基础——例如,与其他源代码共享共同起源的完全独立的项目。
分支和标记子树与主干的区别如下:
Subversion allows sysadmins to create hook scripts which are triggered for execution when certain events occur; for instance, committing a change to the repository. It is very common for a typical Subversion repository implementation to treat any path containing "/tag/" to be write-protected after creation; the net result is that tags, once created, are immutable (at least to "ordinary" users). This is done via the hook scripts, which enforce the immutability by preventing further changes if tag is a parent node of the changed object.
Subversion从1.5版开始还增加了与“分支合并跟踪”相关的特性,这样提交到分支的更改就可以合并回支持增量式“智能”合并的主干中。
我认为一些混淆来自标记概念和SVN中的实现之间的差异。对于SVN来说,标签是一个分支,它是一个副本。修改标签被认为是错误的,事实上,像TortoiseSVN这样的工具会警告你,如果你试图用../tags/..在路上。