我在Subversion(以及一般的存储库)讨论中经常看到这些词。 在过去的几年里,我一直在我的项目中使用SVN,但是我从来没有掌握这些目录的完整概念。
它们是什么意思?
我在Subversion(以及一般的存储库)讨论中经常看到这些词。 在过去的几年里,我一直在我的项目中使用SVN,但是我从来没有掌握这些目录的完整概念。
它们是什么意思?
当前回答
嗯,我不确定我同意尼克重新标签类似于一个分支。标签只是一个标记
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中,标记和分支非常相似。
标签=在时间上定义的片段,通常用于发布
分支=在开发过程中定义的片段,通常用于1.0、1.5、2.0等主要版本,然后在发布时标记分支。这允许您继续支持产品版本,同时在主干中进行突破性的更改
Trunk =开发工作空间,这是所有开发应该发生的地方,然后从分支发布合并回来的更改。
我不太确定“标签”是什么,但分支是一个相当常见的源代码控制概念。
基本上,分支是在不影响主干的情况下对代码进行更改的一种方式。假设您想要添加一个相当复杂的新功能。您希望能够在进行更改时检入更改,但在完成该特性之前不希望它影响trunk。
首先创建一个分支。这基本上是创建分支时的主干副本。然后在分支中完成所有工作。在分支中所做的任何更改都不会影响trunk,因此trunk仍然可用,允许其他人继续在那里工作(比如做错误修复或小的增强)。一旦你的特性完成了,你就可以把分支集成回主干中。这将把所有的更改从分支移动到主干。
人们为分支使用了许多模式。如果您有一个同时支持多个主要版本的产品,通常每个版本都是一个分支。在我工作的地方,我们有一个QA分支和一个生产分支。在向QA发布代码之前,我们将变更集成到QA分支,然后从那里进行部署。当发布到产品时,我们从QA分支集成到生产分支,所以我们知道在生产中运行的代码与QA测试的代码是相同的。
这里是维基百科上关于分支的条目,因为它们可能比我能更好地解释事情。:)
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.
对于熟悉GIT的人来说,GIT中的master相当于SVN中的trunk。
分支和标记在GIT和SVN中有相同的术语。
嗯,我不确定我同意尼克重新标签类似于一个分支。标签只是一个标记
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版开始还增加了与“分支合并跟踪”相关的特性,这样提交到分支的更改就可以合并回支持增量式“智能”合并的主干中。