我在Subversion(以及一般的存储库)讨论中经常看到这些词。 在过去的几年里,我一直在我的项目中使用SVN,但是我从来没有掌握这些目录的完整概念。
它们是什么意思?
我在Subversion(以及一般的存储库)讨论中经常看到这些词。 在过去的几年里,我一直在我的项目中使用SVN,但是我从来没有掌握这些目录的完整概念。
它们是什么意思?
当前回答
中继目录可能是您最熟悉的目录,因为它用于保存最新的更改。你的主要代码库应该在trunk中。
分支目录用于保存分支,无论它们是什么。
标签目录主要用于标记一组特定的文件。您可以对发布版本这样做,其中您希望“1.0”是这些修订版本的这些文件,“1.1”是这些修订版本的这些文件。通常,标签制作完成后就不需要修改了。有关标签的更多信息,请参见第4章。分支和合并(在Subversion版本控制中)。
其他回答
当我在OpenCV 2计算机视觉应用编程烹饪书的作者的网站上查找时,我发现了这个关于SVN的很棒的教程,我想我应该分享一下。
他有一个关于如何使用SVN的教程,以及短语“trunk”、“tag”和“branch”的含义。
直接引用自他的教程:
The current version of your software project, on which your team is currently working is usually located under a directory called trunk. As the project evolves, the developer updates that version fix bugs, add new features) and submit his changes under that directory. At any given point in time, you may want to freeze a version and capture a snapshot of the software as it is at this stage of the development. This generally corresponds to the official versions of your software, for example, the ones you will deliver to your clients. These snapshots are located under the tags directory of your project. Finally, it is often useful to create, at some point, a new line of development for your software. This happens, for example, when you wish to test an alternative implementation in which you have to modify your software but you do not want to submit these changes to the main project until you decide if you adopt the new solution. The main team can then continue to work on the project while other developer work on the prototype. You would put these new lines of development of the project under a directory called 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实际上并不完全复制存储库中的内容。
在SVN中,标记和分支非常相似。
标签=在时间上定义的片段,通常用于发布
分支=在开发过程中定义的片段,通常用于1.0、1.5、2.0等主要版本,然后在发布时标记分支。这允许您继续支持产品版本,同时在主干中进行突破性的更改
Trunk =开发工作空间,这是所有开发应该发生的地方,然后从分支发布合并回来的更改。
对于熟悉GIT的人来说,GIT中的master相当于SVN中的trunk。
分支和标记在GIT和SVN中有相同的术语。
除了Nick所说的,您还可以在流式线:并行软件开发的分支模式中找到更多信息
在这个图中,main是主干,rel1- maintenance是分支,1.0是标记。